mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-11-04 10:06:51 +01:00 
			
		
		
		
	* update phpdocs * replace deprecated $label and $pluralLabel * update record title attributes and labels * update create pages * run pint
		
			
				
	
	
		
			51 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			51 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace App\Filament\Admin\Resources\WebhookResource\Pages;
 | 
						|
 | 
						|
use App\Filament\Admin\Resources\WebhookResource;
 | 
						|
use App\Models\WebhookConfiguration;
 | 
						|
use Filament\Forms\Components\CheckboxList;
 | 
						|
use Filament\Forms\Components\TextInput;
 | 
						|
use Filament\Forms\Form;
 | 
						|
use Filament\Resources\Pages\CreateRecord;
 | 
						|
 | 
						|
class CreateWebhookConfiguration extends CreateRecord
 | 
						|
{
 | 
						|
    protected static string $resource = WebhookResource::class;
 | 
						|
 | 
						|
    protected static bool $canCreateAnother = false;
 | 
						|
 | 
						|
    protected function getHeaderActions(): array
 | 
						|
    {
 | 
						|
        return [
 | 
						|
            $this->getCreateFormAction()->formId('form'),
 | 
						|
        ];
 | 
						|
    }
 | 
						|
 | 
						|
    protected function getFormActions(): array
 | 
						|
    {
 | 
						|
        return [];
 | 
						|
    }
 | 
						|
 | 
						|
    public function form(Form $form): Form
 | 
						|
    {
 | 
						|
        return $form
 | 
						|
            ->schema([
 | 
						|
                TextInput::make('endpoint')
 | 
						|
                    ->activeUrl()
 | 
						|
                    ->required(),
 | 
						|
                TextInput::make('description')
 | 
						|
                    ->required(),
 | 
						|
                CheckboxList::make('events')
 | 
						|
                    ->lazy()
 | 
						|
                    ->options(fn () => WebhookConfiguration::filamentCheckboxList())
 | 
						|
                    ->searchable()
 | 
						|
                    ->bulkToggleable()
 | 
						|
                    ->columns(3)
 | 
						|
                    ->columnSpanFull()
 | 
						|
                    ->gridDirection('row')
 | 
						|
                    ->required(),
 | 
						|
            ]);
 | 
						|
    }
 | 
						|
}
 |