'json', 'description' => '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']; // --------------------------------- Searching --------------------------------- // ***************************************************************************** /** * Get the indexable data array for the model. * * @return array */ public function toSearchableArray() { return [ 'from' => $this->from->timestamp, 'to' => $this->to->timestamp, 'name' => $this->name, ]; } }