ldc-supportweb/app/Http/Requests/StoreProject.php
2021-05-18 19:26:54 +02:00

31 lines
577 B
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class StoreProject extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return auth()->check() and
auth()->user()->role === 1;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name' => 'required|string|min:4|max:30'
];
}
}