guilebc
Custom Action in RelationManager with current record injection
Hello, I can't inject the current record in edit when I use a custom action. Could you please give me an idea?
Thank you for your help.
Here is the code:
public function table(Table $table): Table
{
return $table
->recordTitleAttribute('name')
->columns([
Tables\Columns\TextColumn::make('first_name')->searchable()->sortable(),
Tables\Columns\TextColumn::make('last_name')->searchable()->sortable(),
Tables\Columns\TextColumn::make('email')->searchable()->sortable(),
Tables\Columns\TextColumn::make('created_at')->sortable(),
Tables\Columns\TextColumn::make('updated_at')->sortable()
])
->filters([
//
])
->headerActions([
// Tables\Actions\CreateAction::make(),
Tables\Actions\Action::make('export')
->label('Export CSV')
->action(function($record) {
dd($record);
})
])
->actions([
Tables\Actions\EditAction::make(),
// Tables\Actions\DeleteAction::make(),
])
->bulkActions([
/Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),/
])
->emptyStateActions([
// Tables\Actions\CreateAction::make(),
]);
}
3 replies