|null $metadata * @property Carbon|null $created_at * @property Carbon|null $updated_at * * @method static \Illuminate\Database\Eloquent\Builder|Portfolio newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|Portfolio newQuery() * @method static \Illuminate\Database\Eloquent\Builder|Portfolio query() * @method static \Illuminate\Database\Eloquent\Builder|Portfolio whereActive($value) * @method static \Illuminate\Database\Eloquent\Builder|Portfolio whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Portfolio whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|Portfolio whereMetadata($value) * @method static \Illuminate\Database\Eloquent\Builder|Portfolio whereProfileContainer($value) * @method static \Illuminate\Database\Eloquent\Builder|Portfolio whereProfileId($value) * @method static \Illuminate\Database\Eloquent\Builder|Portfolio whereProfileLayout($value) * @method static \Illuminate\Database\Eloquent\Builder|Portfolio whereProfileSource($value) * @method static \Illuminate\Database\Eloquent\Builder|Portfolio whereShowAvatar($value) * @method static \Illuminate\Database\Eloquent\Builder|Portfolio whereShowBio($value) * @method static \Illuminate\Database\Eloquent\Builder|Portfolio whereShowCaptions($value) * @method static \Illuminate\Database\Eloquent\Builder|Portfolio whereShowLicense($value) * @method static \Illuminate\Database\Eloquent\Builder|Portfolio whereShowLink($value) * @method static \Illuminate\Database\Eloquent\Builder|Portfolio whereShowLocation($value) * @method static \Illuminate\Database\Eloquent\Builder|Portfolio whereShowTimestamp($value) * @method static \Illuminate\Database\Eloquent\Builder|Portfolio whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Portfolio whereUserId($value) * * @mixin \Eloquent */ class Portfolio extends Model { use HasFactory; public $fillable = [ 'profile_id', 'active', 'show_captions', 'show_license', 'show_location', 'show_timestamp', 'show_link', 'show_avatar', 'show_bio', 'profile_layout', 'profile_source', ]; protected function casts(): array { return [ 'metadata' => 'json', ]; } public function url($suffix = '') { $account = AccountService::get($this->profile_id); if (! $account) { return null; } return 'https://'.config('portfolio.domain').config('portfolio.path').'/'.$account['username'].$suffix; } public function permalink($suffix = ''): string { $account = AccountService::get($this->profile_id); return config('app.url').'/account/portfolio/'.$account['username'].$suffix; } }