Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ashler2's avatar

Filament Relationship Manager Create Button

On Filament v3, is there a way to show the create button for a hasMany relationship table on the view page instead of the edit?

I'm using the relationship managers to create/show the records, however i don't like that the create button only shows on the edit page.

I can't seem to see anything on the docs about this or fine anything in the related createdAction methods https://filamentphp.com/docs/3.x/panels/resources/relation-managers#creating-related-records

Just wondering if anyone has come accross this or know roughly where to start with this?

0 likes
3 replies
steveoh's avatar

Curious to know if you got anywhere with this, as I am in the same position...

erchecho's avatar

After checking a while, there is an authorize() method that can be included in the action in the $table declaration of the RelationManager:

->headerActions([
    Tables\Actions\CreateAction::make('create_new_card')
        ->authorize(true)
    ])
             				

Then you can update the authorization according to your policies.

->headerActions([
    Tables\Actions\CreateAction::make('create_new_card')
        ->authorize(auth()->user()->can('create_card'))
    ])
             				

IMPORTANT: The name of the action cannot be 'create' if a CreateAction is defined also in the emptyStateActions.

2 likes
colinhall17's avatar

Had the same issue, took a little more digging but you can make a create button on the view by adding the following in the RelationManager class

public function isReadOnly(): bool { return false; }

3 likes

Please or to participate in this conversation.