ldc-supportweb/app/Http/Requests/StoreProject.php

32 lines
577 B
PHP
Raw Normal View History

2021-04-18 10:43:36 +02:00
<?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;
2021-04-18 10:43:36 +02:00
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name' => 'required|string|min:4|max:30'
];
}
}