*/ use HasFactory; use HasNamiField; public $timestamps = false; public $fillable = ['name', 'nami_id']; public function getShortNameAttribute(): string { return str($this->name) ->trim() ->replaceFirst('Baustein', '') ->trim() ->replaceMatches('/ - .*/', ''); } /** * @return array */ public static function forSelect(): array { return static::select('name', 'id')->get()->toArray(); } }