mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
[2.x] [Filament] Update deprecated getFormSchema
method to use form()
override (#354)
This commit is contained in:
@ -36,18 +36,23 @@ protected function getTableColumns(): array
|
||||
];
|
||||
}
|
||||
|
||||
public function getTable(): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $this->table->actions([
|
||||
Tables\Actions\DeleteAction::make()
|
||||
->label('Remove')
|
||||
->modalHeading('Remove user from project')
|
||||
->visible(function ($record) {
|
||||
return $this->authorize('update', $this->project)->allowed() && $record->id !== auth()->id();
|
||||
})
|
||||
->using(function ($record) {
|
||||
$this->project->users()->detach($record);
|
||||
}),
|
||||
])->paginated(false);
|
||||
return $table
|
||||
->heading(null)
|
||||
->query($this->getTableQuery())
|
||||
->columns($this->getTableColumns())
|
||||
->actions([
|
||||
Tables\Actions\DeleteAction::make()
|
||||
->label('Remove')
|
||||
->modalHeading('Remove user from project')
|
||||
->visible(function ($record) {
|
||||
return $this->authorize('update', $this->project)->allowed() && $record->id !== auth()->id();
|
||||
})
|
||||
->using(function ($record) {
|
||||
$this->project->users()->detach($record);
|
||||
}),
|
||||
])
|
||||
->paginated(false);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user