diff --git a/packages/tables/src/Table.php b/packages/tables/src/Table.php index b9224ea12e..192819b22a 100644 --- a/packages/tables/src/Table.php +++ b/packages/tables/src/Table.php @@ -183,6 +183,16 @@ class Table return $this; } + public function prependRecordActions($actions) + { + $this->recordActions = array_merge( + collect(value($actions))->map(fn ($action) => $action->table($this))->toArray(), + $this->recordActions, + ); + + return $this; + } + public function primaryColumnAction($action) { $this->primaryColumnAction = $action; @@ -201,15 +211,6 @@ class Table return $this; } - public function recordActions($actions) - { - $this->recordActions = collect(value($actions)) - ->map(fn ($action) => $action->table($this)) - ->toArray(); - - return $this; - } - public function pushRecordActions($actions) { $this->recordActions = array_merge( @@ -220,12 +221,11 @@ class Table return $this; } - public function prependRecordActions($actions) + public function recordActions($actions) { - $this->recordActions = array_merge( - collect(value($actions))->map(fn ($action) => $action->table($this))->toArray(), - $this->recordActions, - ); + $this->recordActions = collect(value($actions)) + ->map(fn ($action) => $action->table($this)) + ->toArray(); return $this; } diff --git a/src/Resources/RelationManager.php b/src/Resources/RelationManager.php index 4c2b104c29..ec2a1a400c 100644 --- a/src/Resources/RelationManager.php +++ b/src/Resources/RelationManager.php @@ -84,11 +84,6 @@ class RelationManager extends Component return Filament::can('create', $this->getModel()); } - public function canEdit() - { - return true; - } - public function canDelete() { return true; @@ -106,6 +101,11 @@ class RelationManager extends Component return true; } + public function canEdit() + { + return true; + } + public static function getComponent($component) { return Livewire::getAlias(static::$components[$component]);