SetupUserRequest.php
Go to the documentation of this file.
1 <?php
2 
3 namespace App\Http\Requests;
4 
6 
7 class SetupUserRequest extends Request
8 {
14  public function authorize()
15  {
16  return true;
17  }
18 
24  public function rules()
25  {
26  return [
27  'first_name' => 'required|string|min:1',
28  'last_name' => 'required|string|min:1',
29  'location_id' => 'numeric',
30  'username' => 'required|string|min:2|unique:users,username,NULL,deleted_at',
31  'email' => 'email|unique:users,email',
32  'password' => 'required|min:6',
33  'password_confirm' => 'required|min:6|same:password',
34  'company_id' => 'integer',
35  ];
36  }
37 
38  public function response(array $errors)
39  {
40  return $this->redirector->back()->withInput()->withErrors($errors, $this->errorBag);
41  }
42 }
rules()
Get the validation rules that apply to the request.
authorize()
Determine if the user is authorized to make this request.