getRecord(); $figureImagerUrl = setting('avatar_imager'); if ($figureImagerUrl === '' || $figureImagerUrl === '0') { return ''; } if (! is_object($record)) { return ''; } $figure = $this->figurePointer ? data_get($record, $this->figurePointer) : (property_exists($record, 'look') ? $record->look : null); if (! is_string($figure)) { return ''; } return "{$figureImagerUrl}{$figure}{$this->avatarOptions}"; } public function options(string $avatarOptions): UserAvatarColumn { $this->avatarOptions = $avatarOptions; return $this; } /** * Used to reference the user's figure string through relationships in a Laravel model. By default it will take the look property of the main class. */ public function pointer(string $figurePointer): UserAvatarColumn { $this->figurePointer = $figurePointer; return $this; } }