30 lines
854 B
PHP
30 lines
854 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace App\Http\Requests;
|
||
|
|
|
||
|
|
use App\Models\Idea;
|
||
|
|
use Illuminate\Foundation\Http\FormRequest;
|
||
|
|
use Illuminate\Validation\Rule;
|
||
|
|
|
||
|
|
class UpdateIdeaRequest extends FormRequest
|
||
|
|
{
|
||
|
|
public function authorize(): bool
|
||
|
|
{
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function rules(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'title' => ['sometimes', 'string', 'max:255'],
|
||
|
|
'description' => ['nullable', 'string'],
|
||
|
|
'status' => ['sometimes', 'string', Rule::in(Idea::STATUSES)],
|
||
|
|
'project_id' => ['nullable', 'integer', 'exists:projects,id'],
|
||
|
|
'priority' => ['integer', 'min:0', 'max:10'],
|
||
|
|
'category' => ['nullable', 'string', Rule::in(Idea::CATEGORIES)],
|
||
|
|
'tags' => ['nullable', 'string', 'max:255'],
|
||
|
|
'user_id' => ['nullable', 'integer', 'exists:users,id'],
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|