kirakatou
kirakatou
FFilament
Created by PabloZagni on 7/29/2024 in #❓┊help
createOptionForm not checking policys
@J H u can use when for visibility
Select::make('country_id')->relationship('country', 'name')
->rules(['integer', 'exists:countries,id'])
->searchable()
->preload()
->when(auth()->user()->can('create', Country::class), function ($field) {
return $field->createOptionForm(fn() => CountryResource::formFields());
})
Select::make('country_id')->relationship('country', 'name')
->rules(['integer', 'exists:countries,id'])
->searchable()
->preload()
->when(auth()->user()->can('create', Country::class), function ($field) {
return $field->createOptionForm(fn() => CountryResource::formFields());
})
8 replies