Files
muninn/app/Http/Requests/StoreTaskRequest.php
T

29 lines
760 B
PHP
Raw Normal View History

<?php
namespace App\Http\Requests;
use App\Models\Task;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class StoreTaskRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'title' => ['required', 'string', 'max:255'],
'description' => ['nullable', 'string'],
'status' => ['required', 'string', Rule::in(Task::STATUSES)],
'project_id' => ['required', 'integer', 'exists:projects,id'],
'priority' => ['integer', 'min:0', 'max:10'],
'due_at' => ['nullable', 'date'],
'estimated_hours' => ['nullable', 'integer', 'min:0'],
];
}
}