Multiple Dynamic Path for Slug
Hi Guys , I want to bring $city->name on my slug from ID. I dont know how to achieve it. If you can help me.
Thank you. “
Thank you. “
Forms\Components\Select::make('city_id')
->relationship('cities', 'name')
->required(),
Forms\Components\TextInput::make('name')
->required()
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get){
$city = $get('city_id');
** How can i bring $city->name instead of ID here ? **
$slug = Str::slug($state);
$set('slug', $cityName . '/' . $slug);
}),
Forms\Components\TextInput::make('slug')
->disabled()
->required(), “
6 Replies
City::find($city)->name
?
eloquent?Yes its Eloquent City Model.
Oh i got it. I didnt know its working like that 🙂 One last question. City name is coming with Uppercase. Is there any way to make it lowercase ?
Str::lower($cityName)?
Thank you so much for your help guys. Im sorry if it was silly questions. Im trying to learn filament.
I sorted now.
theyre laravel and php questions, you should learn those before filament
I can do that with laravel but I didnt understand livewire yet. I should learn livewire more. Thank you Dan.