Fix headerActions package resource

This commit is contained in:
Ralph J. Smit
2023-09-28 13:36:32 +02:00
parent 3f1bdb1d8e
commit 9ac72ffda8

View File

@@ -24,13 +24,14 @@ class UsersRelationManager extends RelationManager
public function table(Table $table): Table
{
return UserResource::table($table)
->appendHeaderActions([
->headerActions([
...$table->getHeaderActions(),
Action::make('add_user')
->label(__('Add user'))
->form(fn (self $livewire) => [
->form(fn(self $livewire) => [
Select::make('user_id')
->label('User')
->options(User::orderBy('name')->get()->mapWithKeys(fn (User $user) => [$user->id => $user->name]))
->options(User::orderBy('name')->get()->mapWithKeys(fn(User $user) => [$user->id => $user->name]))
->preload()
->searchable()
->required(),