wip: article AI polish, category SEO fields, cover generator, membership plan seeder
This commit is contained in:
@@ -4,11 +4,12 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Comments\Schemas;
|
||||
|
||||
use App\Domain\Blog\ArticleExcerpt;
|
||||
use App\Models\Comment;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class CommentForm
|
||||
@@ -20,7 +21,22 @@ class CommentForm
|
||||
Select::make('article_id')
|
||||
->label(__('admin.fields.article'))
|
||||
->relationship('article', 'title')
|
||||
->required(),
|
||||
->required()
|
||||
->live(),
|
||||
Textarea::make('article_excerpt_preview')
|
||||
->label(__('admin.fields.article_excerpt'))
|
||||
->disabled()
|
||||
->dehydrated(false)
|
||||
->rows(3)
|
||||
->columnSpanFull()
|
||||
->visible(fn (?Comment $record): bool => $record?->article !== null)
|
||||
->afterStateHydrated(function (Textarea $component, mixed $state, ?Comment $record): void {
|
||||
if ($record?->article === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
$component->state(app(ArticleExcerpt::class)->forList($record->article, 240));
|
||||
}),
|
||||
TextInput::make('author')
|
||||
->label(__('admin.fields.author'))
|
||||
->required(),
|
||||
|
||||
Reference in New Issue
Block a user