Refactor ShiftForm to streamline field definitions and implement unique code generation for shifts based on their names. Update ShiftFactory to utilize the new code generation method.
This commit is contained in:
1 parent
e3ec83686c
commit
28cbef8eb5
4 files changed
+99
-23
No files matched your search
@@ -14,28 +14,25 @@ public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TimePicker::make('starts_at')
|
||||
->label(__('hr.fields.starts_at'))
|
||||
->required()
|
||||
->seconds(false),
|
||||
TimePicker::make('ends_at')
|
||||
->label(__('hr.fields.ends_at'))
|
||||
->required()
|
||||
->seconds(false),
|
||||
|
||||
TextInput::make('name')
|
||||
->label(__('hr.fields.name'))
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('code')
|
||||
->label(__('hr.fields.code'))
|
||||
->required()
|
||||
->maxLength(50)
|
||||
->unique(ignoreRecord: true),
|
||||
TimePicker::make('starts_at')
|
||||
->label(__('hr.fields.starts_at'))
|
||||
->required()
|
||||
->seconds(false),
|
||||
TimePicker::make('ends_at')
|
||||
->label(__('hr.fields.ends_at'))
|
||||
->required()
|
||||
->seconds(false),
|
||||
|
||||
Textarea::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
Toggle::make('is_active')
|
||||
->rows(3),
|
||||
|
||||
Toggle::make('is_active')
|
||||
->label(__('hr.fields.active'))
|
||||
->default(true)
|
||||
->required(),
|
||||
|
||||
Reference in new issue
Block a user