42 lines
1.2 KiB
PHP
42 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Shifts\Schemas;
|
|
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Forms\Components\Textarea;
|
|
use Filament\Forms\Components\TimePicker;
|
|
use Filament\Forms\Components\Toggle;
|
|
use Filament\Schemas\Schema;
|
|
|
|
class ShiftForm
|
|
{
|
|
public static function configure(Schema $schema): Schema
|
|
{
|
|
return $schema
|
|
->components([
|
|
TextInput::make('name')
|
|
->required()
|
|
->maxLength(255),
|
|
TextInput::make('code')
|
|
->required()
|
|
->maxLength(50)
|
|
->unique(ignoreRecord: true),
|
|
TimePicker::make('starts_at')
|
|
->label('Starts at')
|
|
->required()
|
|
->seconds(false),
|
|
TimePicker::make('ends_at')
|
|
->label('Ends at')
|
|
->required()
|
|
->seconds(false),
|
|
Textarea::make('description')
|
|
->rows(3)
|
|
->columnSpanFull(),
|
|
Toggle::make('is_active')
|
|
->label('Active')
|
|
->default(true)
|
|
->required(),
|
|
]);
|
|
}
|
|
}
|