feat: tambah Filament 5 resources dengan schemas dan tables
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Activities\Schemas;
|
||||
|
||||
use App\Models\User;
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class ActivityForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema->components([
|
||||
TextInput::make('title')->label('Judul')->required(),
|
||||
Textarea::make('description')->label('Deskripsi')->rows(3)->columnSpanFull(),
|
||||
DatePicker::make('start_date')->label('Mulai')->required(),
|
||||
DatePicker::make('end_date')->label('Selesai')->required(),
|
||||
Select::make('status')
|
||||
->options([
|
||||
'draft' => 'Draft',
|
||||
'pending' => 'Pending',
|
||||
'approved' => 'Disetujui',
|
||||
'rejected' => 'Ditolak',
|
||||
])
|
||||
->default('draft')
|
||||
->required(),
|
||||
Select::make('participants')
|
||||
->label('Peserta')
|
||||
->relationship('participants', 'name')
|
||||
->multiple()
|
||||
->preload()
|
||||
->searchable()
|
||||
->columnSpanFull(),
|
||||
DateTimePicker::make('executed_at')->label('Waktu Pelaksanaan'),
|
||||
Textarea::make('execution_notes')->label('Catatan Pelaksanaan')->rows(3)->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user