26 lines
568 B
PHP
26 lines
568 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace App\Http\Requests;
|
||
|
|
|
||
|
|
use App\Models\Project;
|
||
|
|
use Illuminate\Foundation\Http\FormRequest;
|
||
|
|
use Illuminate\Validation\Rule;
|
||
|
|
|
||
|
|
class StoreProjectRequest extends FormRequest
|
||
|
|
{
|
||
|
|
public function authorize(): bool
|
||
|
|
{
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function rules(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'name' => ['required', 'string', 'max:255'],
|
||
|
|
'description' => ['nullable', 'string'],
|
||
|
|
'status' => ['required', 'string', Rule::in(Project::STATUSES)],
|
||
|
|
'due_at' => ['nullable', 'date'],
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|