2017-01-30 21:40:43 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Requests;
|
2016-11-29 19:47:26 +02:00
|
|
|
|
2019-01-30 22:00:26 +11:00
|
|
|
use App\Models\Project;
|
|
|
|
|
|
2016-11-29 19:47:26 +02:00
|
|
|
class CreateProjectRequest extends ProjectRequest
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Determine if the user is authorized to make this request.
|
|
|
|
|
*
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
|
|
|
|
public function authorize()
|
|
|
|
|
{
|
2019-01-30 22:00:26 +11:00
|
|
|
return $this->user()->can('create', Project::class);
|
2016-11-29 19:47:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the validation rules that apply to the request.
|
|
|
|
|
*
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
public function rules()
|
|
|
|
|
{
|
|
|
|
|
return [
|
2017-11-15 21:49:42 +02:00
|
|
|
'name' => 'required',
|
2016-12-15 14:17:10 +02:00
|
|
|
'client_id' => 'required',
|
2016-11-29 19:47:26 +02:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|