Skip to content

Commit a337baa

Browse files
committed
Improve the way to get the last updated
1 parent adcdb13 commit a337baa

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

ProcessMaker/Models/User.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,8 @@ public function setAvatarAttribute($value = null)
308308
*/
309309
public function getAvatar()
310310
{
311-
$mediaFile = $this->getMedia(self::COLLECTION_PROFILE);
312-
$url = '';
313-
foreach ($mediaFile as $media) {
314-
$url = $media->getFullUrl();
315-
}
316-
311+
$media = $this->getMedia(self::COLLECTION_PROFILE);
312+
$url = $media->last()->getFullUrl();
317313
return $url;
318314
}
319315

0 commit comments

Comments
 (0)