invoiceninja/app/Http/Requests/UpdateProjectRequest.php

33 lines
595 B
PHP
Raw Normal View History

2017-01-30 21:40:43 +02:00
<?php
namespace App\Http\Requests;
2016-11-29 19:47:26 +02:00
class UpdateProjectRequest extends ProjectRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
2017-07-12 23:56:31 +03:00
return $this->entity() && $this->user()->can('edit', $this->entity());
2016-11-29 19:47:26 +02:00
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
2017-07-12 23:56:31 +03:00
if (! $this->entity()) {
return [];
}
2017-01-30 18:05:31 +02:00
return [
2017-11-15 21:49:42 +02:00
'name' => 'required',
2016-11-29 19:47:26 +02:00
];
}
}