feat(article): enhance article form with improved placeholders and default status value
This commit is contained in:
parent
2b101764a8
commit
ba616954cb
@ -3,6 +3,7 @@
|
||||
namespace App\Livewire\Datatable\Studio\Manage;
|
||||
|
||||
use App\Models\Article;
|
||||
use App\Traits\Datatable\WithAppendColumn;
|
||||
use App\Traits\Datatable\WithConfiguration;
|
||||
use App\Traits\Datatable\WithPrependColumn;
|
||||
use App\Traits\WithMediaHandler;
|
||||
@ -13,7 +14,7 @@
|
||||
|
||||
class ArticlesTable extends DataTableComponent
|
||||
{
|
||||
use WithConfiguration, WithMediaHandler, WithPrependColumn;
|
||||
use WithAppendColumn, WithConfiguration, WithMediaHandler, WithPrependColumn;
|
||||
|
||||
protected $model = Article::class;
|
||||
|
||||
@ -30,6 +31,10 @@ public function columns(): array
|
||||
)
|
||||
->html(),
|
||||
|
||||
Column::make('Waktu Publish', 'published_at')
|
||||
->format(fn ($value) => formatDateTime($value))
|
||||
->searchable(),
|
||||
|
||||
Column::make('Aksi')
|
||||
->label(function ($row) {
|
||||
$actions = '';
|
||||
|
||||
@ -21,7 +21,7 @@ class ArticleForm extends Form
|
||||
|
||||
public string $content = '';
|
||||
|
||||
public string $status = '';
|
||||
public string $status = '1';
|
||||
|
||||
public array $thumbnail = [];
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ protected function casts(): array
|
||||
public function getSlugOptions(): SlugOptions
|
||||
{
|
||||
return SlugOptions::create()
|
||||
->generateSlugsFrom('name')
|
||||
->generateSlugsFrom('title')
|
||||
->saveSlugsTo('slug');
|
||||
}
|
||||
|
||||
|
||||
@ -17,22 +17,22 @@
|
||||
<flux:card class="space-y-6 p-6">
|
||||
<flux:field>
|
||||
<flux:label>Judul <span class="text-red-500 ms-1">*</span></flux:label>
|
||||
<flux:input placeholder="Masukkan judul" wire:model.live.debounce.500ms="form.title"
|
||||
autofocus autocomplete="off" />
|
||||
<flux:input placeholder="Contoh: Tips Memilih Parfum"
|
||||
wire:model.live.debounce.500ms="form.title" autofocus autocomplete="off" />
|
||||
<flux:error name="form.title" />
|
||||
</flux:field>
|
||||
|
||||
<flux:field>
|
||||
<flux:label>Cuplikasn <span class="text-red-500 ms-1">*</span></flux:label>
|
||||
<flux:editor wire:model="form.excerpt" placeholder="Masukkan cuplikan" auotocomplete="off"
|
||||
class="**:data-[slot=content]:min-h-[100px]!" />
|
||||
<flux:editor wire:model="form.excerpt" placeholder="Masukan inti artikel yang menarik"
|
||||
auotocomplete="off" class="**:data-[slot=content]:min-h-[100px]!" />
|
||||
<flux:error name="form.excerpt" />
|
||||
</flux:field>
|
||||
|
||||
<flux:field>
|
||||
<flux:label>Konten <span class="text-red-500 ms-1">*</span></flux:label>
|
||||
<flux:editor wire:model="form.content" placeholder="Masukkan konten" auotocomplete="off"
|
||||
class="**:data-[slot=content]:min-h-[100px]!" />
|
||||
<flux:editor wire:model="form.content" placeholder="Masukan konten artikel"
|
||||
auotocomplete="off" class="**:data-[slot=content]:min-h-[100px]!" />
|
||||
<flux:error name="form.content" />
|
||||
</flux:field>
|
||||
</flux:card>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user