32 lines
677 B
PHP
32 lines
677 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Bo\Projects;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Support\Facades\Gate;
|
|
|
|
class StoreProjectRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function authorize()
|
|
{
|
|
return Gate::allows('isAdmin');
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
'name' => 'required|string|min:3|max:255|unique:projects,name',
|
|
'site_id' => 'required|exists:sites,id',
|
|
];
|
|
}
|
|
}
|