trypost/app/Http/Requests/App/Workspace/UpdateWorkspaceRequest.php

35 lines
826 B
PHP
Raw Normal View History

2026-01-15 01:13:44 +00:00
<?php
declare(strict_types=1);
namespace App\Http\Requests\App\Workspace;
2026-01-15 01:13:44 +00:00
use App\Rules\Timezone;
2026-01-15 01:13:44 +00:00
use Illuminate\Foundation\Http\FormRequest;
class UpdateWorkspaceRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:255'],
'timezone' => ['required', 'string', new Timezone],
2026-01-15 01:13:44 +00:00
];
}
public function messages(): array
{
return [
2026-01-15 17:24:39 +00:00
'name.required' => 'The workspace name is required.',
'name.max' => 'The workspace name must be at most 255 characters.',
'timezone.required' => 'Please select a timezone.',
'timezone.timezone' => 'Please select a valid timezone.',
2026-01-15 01:13:44 +00:00
];
}
}