dwiser
dwiser
FFilament
Created by dwiser on 3/26/2025 in #❓┊help
Header actions on "another" View page broken
What I did: I created another view page as outlined in the docs here: https://filamentphp.com/docs/3.x/panels/resources/viewing-records#creating-another-view-page php artisan make:filament-page ViewRequestApproval --resource=RequestResource --type=ViewRecord I also added actions to the page header as outlined in the docs here: https://filamentphp.com/docs/3.x/panels/pages#header-actions What happens: When I click the action button, I get an "Unable to find component: error". What I tried: - Moving the same page between resources seems to cause the same problem no matter what resource the page and action is nested under. - An action with a ->url() seems to redirect fine but any ->form() or ->action() method seems to cause the same error about a missing component. - Adding the Action to a standard ViewResource page gives the same error. Code Reference In App\Filament\App\Resources\RequestResource: class RequestResource extends Resource { public static function getPages(): array { return [ 'index' => Pages\ManageRequests::route('/'), 'view-approval' => Pages\ViewRequestApproval::route('/{record}/approval'), ]; } } In App\Filament\App\Resources\RequestResource\Pages\ViewRequestApproval: class ViewRequestApproval extends ViewRecord { protected function getHeaderActions(): array { return [ \Filament\Actions\Action::make('approve') ->action(function (Request $record) { dump($record); $record->approve(); $this->refreshFormData([ 'status', ]); }) ]; } } Error message: Unable to find component: [app.filament.app.resources.request-resource.pages.view-request-approval] vendor/livewire/livewire/src/Mechanisms/ComponentRegistry.php#116 Livewire\Exceptions\ComponentNotFoundException
4 replies
FFilament
Created by dwiser on 2/19/2024 in #❓┊help
CreateBulkAction plugin?
Has anyone created a table action button to bulk create relationships from the selected parent records? I have a table of projects that I would like to bulk select and create a new relationship for each of them. Has anyone created something similar?
1 replies
FFilament
Created by dwiser on 2/16/2024 in #❓┊help
Action button for creating relation on view page
I'm trying to duplicate the CreateAction button that is created with a RelationManager so that I can add it to the top of a ViewRecord page. I got myself most of the way there with associating a model and reusing the Resource form but I'm not sure how to pass the record of the ViewRecord page to the form and also hide the select element in the form that pertains to the record being viewed.
// Resources\ProjectResource\Pages\ViewProject->getHeaderActions():
return [
...
Actions\CreateAction::make()
->model(Shift::class)
->label('Add Shift')
->form(fn (Forms\Form $form) => ShiftResource::form($form)),
...
];

// Resources\ShiftResource::form(Forms\Form $form):
return $form
->schema([
...
Forms\Components\Select::make('project_uuid')
->required()
->relationship(name: 'project', titleAttribute: 'name')
->searchable()
->preload()
->optionsLimit(20)
->columnSpan([
'sm' => 2,
'xl' => 3,
])
->hiddenOn(ProjectShiftsRelationManager::class),
...
]);
// Resources\ProjectResource\Pages\ViewProject->getHeaderActions():
return [
...
Actions\CreateAction::make()
->model(Shift::class)
->label('Add Shift')
->form(fn (Forms\Form $form) => ShiftResource::form($form)),
...
];

// Resources\ShiftResource::form(Forms\Form $form):
return $form
->schema([
...
Forms\Components\Select::make('project_uuid')
->required()
->relationship(name: 'project', titleAttribute: 'name')
->searchable()
->preload()
->optionsLimit(20)
->columnSpan([
'sm' => 2,
'xl' => 3,
])
->hiddenOn(ProjectShiftsRelationManager::class),
...
]);
5 replies
FFilament
Created by dwiser on 10/6/2023 in #❓┊help
$set all checked in nested CheckboxList
I am creating a form section visually similar to the bezhansalleh/filament-shield package but for project notification options instead of spatie permissions. When creating a user, there is a Section for every project, each including a Toggle and a CheckboxList to choose individual notifications or all in bulk. Changing the Toggle will update all the Checkboxes to the same state and unchecking any one Checkbox will change the Toggle to off. I can't seem to find a way to reference each individual CheckboxList item using $set. A bulk toggle of the checkbox list would likely solve my issue but I'm using the opportunity to better understand filament and keep the preferred UI instead of fall back to the bulk toggle method.
5 replies