F
Filament10mo ago
Matthew

How to add actions to custom header view

Trait method Filament\Actions\Concerns\InteractsWithActions::afterActionCalled has not been applied as App\Filament\Resources\TicketsResource\Pages\ViewTickets::afterActionCalled, because of collision with Filament\Resources\Pages\Concerns\InteractsWithRecord::afterActionCalled https://flareapp.io/share/w5BZG2v5
Flare
Trait method Filament\Actions\Concerns\InteractsWithActions::afterActionCalled has not been applied as App\Filament\Resources\TicketsResource\Pages\ViewTickets::afterActionCalled, because of collision with Filament\Resources\Pages\Concerns\InteractsWithRecord::afterActionCalled - The error occurred at http://localhost:8000/app/tickets/4
Solution:
Solved!
Jump to solution
11 Replies
Matthew
MatthewOP10mo ago
Im just trying to add header actions to my page And i followed documentation. This leads me to believe that it could be a bug in filament
Matthew
MatthewOP10mo ago
I need the record trait Even if I do
use InteractsWithRecord, InteractsWithActions {
InteractsWithRecord::afterActionCalled insteadof InteractsWithActions;
}
use InteractsWithRecord, InteractsWithActions {
InteractsWithRecord::afterActionCalled insteadof InteractsWithActions;
}
It "fixes" just that method. Then it shows other methods as errors as well. The issue lies elsewhere.... Bump
awcodes
awcodes10mo ago
Says it right there in the docs. Pages already have the trait applied, so you don’t need to add it yourself.
Matthew
MatthewOP10mo ago
Well, if I remove InteractsWithRecord, then how can I get the record?
awcodes
awcodes10mo ago
what i'm saying you don't need is InteractsWithActions
Matthew
MatthewOP10mo ago
Weird, because I cant see the header actions
protected function getHeaderActions(): array
{
return [
EditAction::make(),
// secret
];
}
protected function getHeaderActions(): array
{
return [
EditAction::make(),
// secret
];
}
I fugured it out
awcodes
awcodes10mo ago
might want to source dive a little to see how the pages are setup in the panels package. that should give you some better insight
Matthew
MatthewOP10mo ago
its because I have a custom header view So I need to add the <x-filament-actions::modals /> there right? Still didnt work 🥲
Matthew
MatthewOP10mo ago
I went through the files and I found this in vendor/filament/filament/resources/views/components/page/index.blade.php:
Solution
Matthew
Matthew10mo ago
Solved!
Want results from more Discord servers?
Add your server