Add Form Requests for Groups validation

This commit is contained in:
Bubka 2021-09-21 22:44:25 +02:00
parent 672e189e55
commit c7e273a580
3 changed files with 62 additions and 1 deletions

View File

@ -0,0 +1,31 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class GroupAssignRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'ids' => 'required|array',
'ids.*' => 'integer'
];
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class GroupStoreRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name' => 'required|string|max:32|unique:groups',
];
}
}

View File

@ -4,7 +4,7 @@
use Illuminate\Foundation\Http\FormRequest;
class TwoFAccountBatchDestroyRequest extends FormRequest
class TwoFAccountBatchRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.