Use request validation

This commit is contained in:
ben committed 2023-10-09 07:29:02 -04:00
1 parent 671d422bff
commit b26174f420
2 files changed
+35 -15

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class StoreUserRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'firstname' => ['required', 'string'],
'lastname' => ['required', 'string'],
'email' => ['required', 'string'],
'uuid' => ['required', 'string'],
'profile' => ['required', 'string'],
];
}
}