mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Add ability to disable RelationManager list edit action
This commit is contained in:
@@ -84,6 +84,11 @@ class RelationManager extends Component
|
||||
return Filament::can('create', $this->getModel());
|
||||
}
|
||||
|
||||
public function canEdit()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function canDelete()
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -95,6 +95,10 @@ class ListRecords extends Component
|
||||
{
|
||||
$manager = $this->manager;
|
||||
|
||||
if (!app($manager)->canEdit()) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return [
|
||||
RecordActions\Link::make('edit')
|
||||
->label($manager::$editRecordActionLabel)
|
||||
|
||||
Reference in New Issue
Block a user