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

33 lines
624 B
PHP
Raw Normal View History

2021-04-18 10:43:36 +02:00
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
2021-07-23 11:34:16 +02:00
class StoreSite extends FormRequest
2021-04-18 10:43:36 +02:00
{
/**
* Determine if the user is authorized to make this request.
*
2022-03-29 16:57:54 +02:00
* @return boolean
2021-04-18 10:43:36 +02:00
*/
public function authorize()
{
2021-07-23 11:04:09 +02:00
/** @var \App\Models\User */
$user = auth()->user();
return auth()->check() and $user->isAdmin();
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'
];
}
}