31 lines
764 B
PHP
31 lines
764 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
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', 'timezone:all'],
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'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.',
|
|
];
|
|
}
|
|
}
|