slug
Created at: 2022-12-24 01:20:48 | Updated at: 2024-07-31 06:59:17
Per generar un slug a partir d'un títol mentre l'usuari està escrivint, podeu utilitzar el afterStateUpdated()mètode del camp del títol al $set()valor del camp slug:
Forms\Components\TextInput::make('nom') ->required() ->reactive() ->afterStateUpdated(function (Closure $set, $state) { $set('slug', Str::slug($state)); }), Forms\Components\TextInput::make('slug'),
No valid image directory found or the category is not valid for the gallery.