Dhaval Kacha
Dhaval Kacha
FFilament
Created by Dhaval Kacha on 11/30/2023 in #❓┊help
hide field conditionally and submit values accordingly.
Hi there! I wan to achieve something like if user has role admin then show this
Select::make('user_id')
->options(
User::with('roles')->whereHas('roles', function ($query) { $query->where('name', 'manager');
)->pluck('name','id')
)->searchable()
->label('Managers')
Select::make('user_id')
->options(
User::with('roles')->whereHas('roles', function ($query) { $query->where('name', 'manager');
)->pluck('name','id')
)->searchable()
->label('Managers')
otherwise i want to submit default value like this
Hidden::make('user_id')
->default(auth()->id())
Hidden::make('user_id')
->default(auth()->id())
how to achieve that? Thanks!
12 replies
FFilament
Created by Dhaval Kacha on 11/23/2023 in #❓┊help
How to add only edit form to a livewire component.
No description
22 replies
FFilament
Created by Dhaval Kacha on 11/7/2023 in #❓┊help
In AdminPanelProvider I want Plugin (FilamentSpatieRolesPermissionsPlugin) only be loaded for admin.
In my AdminPanelProvider I want a Plugin (FilamentSpatieRolesPermissionsPlugin) only be loaded if Auth::user()->hasRole('admin') But whenever I do this, I get: Target class [hash] does not exist. for if(Auth::user()->hasRole('admin')) How would y'all fix this or get a way around it
4 replies