mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-29 14:24:46 +02:00

* Move these Move List/Create to their own pages to follow the flow of the other resources. * Move EditPage aswell * Move Save * Labels * Change Edit/Delete --------- Co-authored-by: RMartinOscar <40749467+RMartinOscar@users.noreply.github.com>
58 lines
1.7 KiB
PHP
58 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\WebhookResource\Pages;
|
|
|
|
use App\Models\WebhookConfiguration;
|
|
use App\Filament\Resources\WebhookResource;
|
|
use Filament\Actions;
|
|
use Filament\Forms\Components\CheckboxList;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Forms\Form;
|
|
use Filament\Resources\Pages\EditRecord;
|
|
|
|
class EditWebhookConfiguration extends EditRecord
|
|
{
|
|
protected static string $resource = WebhookResource::class;
|
|
|
|
public function form(Form $form): Form
|
|
{
|
|
return $form
|
|
->schema([
|
|
TextInput::make('endpoint')
|
|
->label('Endpoint')
|
|
->activeUrl()
|
|
->required(),
|
|
TextInput::make('description')
|
|
->label('Description')
|
|
->required(),
|
|
CheckboxList::make('events')
|
|
->label('Events')
|
|
->lazy()
|
|
->options(fn () => WebhookConfiguration::filamentCheckboxList())
|
|
->searchable()
|
|
->bulkToggleable()
|
|
->columns(3)
|
|
->columnSpanFull()
|
|
->gridDirection('row')
|
|
->required(),
|
|
]);
|
|
}
|
|
|
|
protected function getFormActions(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
Actions\DeleteAction::make()
|
|
->label('Delete')
|
|
->modalHeading('Are you sure you want to delete this?')
|
|
->modalDescription('')
|
|
->modalSubmitActionLabel('Delete'),
|
|
$this->getSaveFormAction()->formId('form'),
|
|
];
|
|
}
|
|
}
|