public static function form(Form $form): Form
{
return $form
->schema(Card::make([
Select::make('activity_id')
->label('Activity')
->options(Activity::all()->pluck('name', 'id'))
->searchable()
->required(),
Forms\Components\Textarea::make('description')
->required()
->maxLength(500),
Forms\Components\DateTimePicker::make('date')
->withoutTime()
->required()
->columnSpan(1),
Forms\Components\TimePicker::make('time')
->withoutDate()
->withoutSeconds()
->required()
->columnSpan(1),
Select::make('project_id')
->label('Project')
->options(Project::all()->pluck('name', 'id'))
->searchable()
->required()
->columnSpan(1),
Select::make('worker_user_id')
->label('Worker')
->options(User::all()->pluck('name', 'id'))
->searchable()
->required()
->disabled(!auth()->user()->can('show_everything_time::registration'))
->default(Auth()->id())
->columnSpan(1),
Select::make('task_id')
->label('Select Task')
->options(Task::all()->pluck('name', 'id'))
->columnSpan(1),
])->columns(2));
}
public static function form(Form $form): Form
{
return $form
->schema(Card::make([
Select::make('activity_id')
->label('Activity')
->options(Activity::all()->pluck('name', 'id'))
->searchable()
->required(),
Forms\Components\Textarea::make('description')
->required()
->maxLength(500),
Forms\Components\DateTimePicker::make('date')
->withoutTime()
->required()
->columnSpan(1),
Forms\Components\TimePicker::make('time')
->withoutDate()
->withoutSeconds()
->required()
->columnSpan(1),
Select::make('project_id')
->label('Project')
->options(Project::all()->pluck('name', 'id'))
->searchable()
->required()
->columnSpan(1),
Select::make('worker_user_id')
->label('Worker')
->options(User::all()->pluck('name', 'id'))
->searchable()
->required()
->disabled(!auth()->user()->can('show_everything_time::registration'))
->default(Auth()->id())
->columnSpan(1),
Select::make('task_id')
->label('Select Task')
->options(Task::all()->pluck('name', 'id'))
->columnSpan(1),
])->columns(2));
}