Files
larablog/app/Filament/Resources/Articles/Pages/CreateArticle.php
T
ak 263b98b218 Initial baseline: LaraBlog core with plugin commerce surface.
Captures the current working tree after theme slots, ArticleAccess, and the payment / paid-content plugins so subsequent work has a reviewable git history.
2026-08-12 01:15:38 +08:00

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());
}
}