'json', ]; /** * @return SluggableConfig */ public function sluggable(): array { return [ 'slug' => ['source' => ['name']], ]; } public function registerMediaCollections(): void { $this->addMediaCollection('headerImage') ->singleFile() ->maxWidth(fn () => 500) ->forceFileName(fn (Form $model, string $name) => $model->slug) ->registerMediaConversions(function (Media $media) { $this->addMediaConversion('square')->fit(Manipulations::FIT_CROP, 400, 400); }); } /** @var array */ public $dates = ['from', 'to', 'registration_from', 'registration_until']; /** * @param Builder $query * * @return Builder */ public function scopeWithFilter(Builder $query, FilterScope $filter): Builder { return $filter->apply($query); } }