heading('') ->columns([ TextColumn::make('id'), TextColumn::make('name'), ]) ->headerActions([ Action::make('create') ->form(fn () => [ TextInput::make('name') ->inlineLabel() ->live() ->required(), ]) ->action(function (array $data) { $id = WebhookEvent::firstOrCreate([ 'name' => $data['name'], ]); $this->getOwnerRecord()->webhookEvents()->sync([$id]); }), ]) ->actions([ DeleteAction::make() ->authorize(fn (WebhookConfiguration $config) => auth()->user()->can('delete', $config)), ]); } }