You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

41 lines
1.1 KiB

<?php
namespace App\Http\Requests\Projects;
use App\Http\Requests\Request;
use App\Entities\Projects\Project;
class UpdateRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
$project = Project::findOrFail($this->segment(2));
return auth()->user()->can('update', $project);
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name' => 'required|max:50',
'description' => 'nullable|max:255',
'proposal_date' => 'nullable|date|date_format:Y-m-d',
'proposal_value' => 'nullable|numeric',
'start_date' => 'nullable|date|date_format:Y-m-d',
'end_date' => 'nullable|date|date_format:Y-m-d',
'due_date' => 'nullable|date|date_format:Y-m-d',
'project_value' => 'nullable|numeric',
'customer_id' => 'nullable|numeric',
];
}
}