Skip to content

Commit

Permalink
feat: add user request validation
Browse files Browse the repository at this point in the history
  • Loading branch information
phojie committed Nov 6, 2022
1 parent b4f728c commit ae4e7c4
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions app/Http/Requests/UserRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UserRequest 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<string, mixed>
*/
public function rules()
{
return [
'username' => 'required|unique:users,username',
'email' => 'required|email|unique:users,email',
'password' => 'required',
'password_confirmation' => 'required|same:password',
];
}
}

0 comments on commit ae4e7c4

Please sign in to comment.