Bogardo
Bogardo
FFilament
Created by Bogardo on 11/24/2023 in #❓┊help
Modify modal actions within RelationManager
I have a RelationManager which shows a table of items, when I click an item a modal opens up with the form defined in my RelationManager. This modal has two (default) buttons/actions: - Save changes - Cancel Where are these action defined, and how/where can I add my own actions? Contents of my RelationManager:
<?php

namespace App\Filament\Resources\UserResource\RelationManagers;

use App\Models\TypeformForm;
use Filament\Forms;
use Filament\Forms\Components\Section;
use Filament\Forms\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Tables;
use Filament\Tables\Table;

class FormsRelationManager extends RelationManager
{
protected static string $relationship = 'forms';

public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('title')
]);
}

public function table(Table $table): Table
{
return $table
->defaultSort('updated_at', 'desc')
->recordTitleAttribute('title')
->columns([
Tables\Columns\TextColumn::make('id')->label('ID'),
Tables\Columns\TextColumn::make('title'),
])
->filters([
//
])
->headerActions([
//
])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
//
]);
}
}
<?php

namespace App\Filament\Resources\UserResource\RelationManagers;

use App\Models\TypeformForm;
use Filament\Forms;
use Filament\Forms\Components\Section;
use Filament\Forms\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Tables;
use Filament\Tables\Table;

class FormsRelationManager extends RelationManager
{
protected static string $relationship = 'forms';

public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('title')
]);
}

public function table(Table $table): Table
{
return $table
->defaultSort('updated_at', 'desc')
->recordTitleAttribute('title')
->columns([
Tables\Columns\TextColumn::make('id')->label('ID'),
Tables\Columns\TextColumn::make('title'),
])
->filters([
//
])
->headerActions([
//
])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
//
]);
}
}
2 replies