'datetime', // ]; public function getFolder() { $arrayHash = str_split(strtolower(md5($this->id))); return sprintf('%s/%s', $arrayHash[0], $arrayHash[1]); } /** * @return bool */ public function isE2E() { return (bool) $this->encrypt_messages; } /** * @param Media|null $media */ public function registerMediaConversions(Media $media = null) { try { $this->addMediaConversion('thumb') ->width(50) ->height(50); } catch (InvalidManipulation $e) { } } /** * @param string $alias * @return string */ public function getAvatar($alias = 'thumb') { return $this->getFirstMediaUrl('avatars'); } }