7e367d67da
* Tasks are now edited inline * Tasks can be marked as completed * Tasks can be edited
37 lines
684 B
PHP
37 lines
684 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\People;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class TasksRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function authorize()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
if ($this->method() === 'PATCH') {
|
|
return [];
|
|
}
|
|
|
|
return [
|
|
'title' => 'required|string',
|
|
'description' => 'nullable',
|
|
'completed' => 'required|boolean',
|
|
];
|
|
}
|
|
}
|