Captures the current working tree after theme slots, ArticleAccess, and the payment / paid-content plugins so subsequent work has a reviewable git history.
31 lines
789 B
PHP
31 lines
789 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\Resources\Articles\Pages;
|
|
|
|
use App\Domain\Plugin\Hook;
|
|
use App\Filament\Resources\Articles\ArticleResource;
|
|
use Filament\Resources\Pages\CreateRecord;
|
|
|
|
class CreateArticle extends CreateRecord
|
|
{
|
|
protected static string $resource = ArticleResource::class;
|
|
|
|
/**
|
|
* @param array<string, mixed> $data
|
|
* @return array<string, mixed>
|
|
*/
|
|
protected function mutateFormDataBeforeCreate(array $data): array
|
|
{
|
|
$filtered = Hook::filter('filament.article.mutate_before_save', $data, null);
|
|
|
|
return is_array($filtered) ? $filtered : $data;
|
|
}
|
|
|
|
protected function afterCreate(): void
|
|
{
|
|
Hook::dispatch('filament.article.after_save', $this->record, $this->form->getState());
|
|
}
|
|
}
|