Desmond Njuguna
multiple panels on single dashboard as tabs?
Hi Povilas, Panel switching is actually possible. There's a plugin for that, https://filamentphp.com/plugins/bezhansalleh-panel-switch, and you can also restrict who can and cannot use the panel swith, aither with roles or permissions
9 replies
My Resorce has Form I want to call it or inheritance this form in another palce
you can define a getForm static method in the corresponding model then call the form in any resource you want
Eg if you have a tag model and the resources, in the Tag model define a new methid like so
public static function getForm(): array
{
return [
TextInput::make('name')
->required()
->maxLength(255),
ColorPicker::make('color')
->required(),
];
}
Then in the tagresource form method do this
public static function form(Form $form): Form
{
return $form
->schema(Task::getForm());
}
I suppose you have a userresource and you might want to create a new tag without necessarily goung back to the tag resource, so in the tag form component of the userresource form method you can chain the method createOptionForm(App\Models\Tag::getForm()) and have it complete as so
Select::make('tags')
->relationship('tags', 'name',)
->multiple()
->searchable()
->preload()
->createOptionForm(Tag::getForm())
Hope this is what youre looking for
7 replies