Organize requests differently.
This commit is contained in:
29
app/Http/Requests/Auth/EmailPasswordLinkRequest.php
Normal file
29
app/Http/Requests/Auth/EmailPasswordLinkRequest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php namespace App\Http\Requests\Auth;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class EmailPasswordLinkRequest extends Request {
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'email' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
29
app/Http/Requests/Auth/LoginRequest.php
Normal file
29
app/Http/Requests/Auth/LoginRequest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php namespace App\Http\Requests\Auth;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class LoginRequest extends Request {
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'email' => 'required', 'password' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
31
app/Http/Requests/Auth/RegisterRequest.php
Normal file
31
app/Http/Requests/Auth/RegisterRequest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php namespace App\Http\Requests\Auth;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class RegisterRequest extends Request {
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required|max:255',
|
||||
'email' => 'required|email|max:255|unique:users',
|
||||
'password' => 'required|min:6|confirmed',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
31
app/Http/Requests/Auth/ResetPasswordRequest.php
Normal file
31
app/Http/Requests/Auth/ResetPasswordRequest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php namespace App\Http\Requests\Auth;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class ResetPasswordRequest extends Request {
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'token' => 'required',
|
||||
'email' => 'required',
|
||||
'password' => 'required|confirmed',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user