11<?php
2-
32namespace App \Http \Controllers \Auth ;
43
54use App \Http \Controllers \Controller ;
65use App \User ;
7- use Illuminate \Foundation \Auth \AuthenticatesAndRegistersUsers ;
8- use Illuminate \Foundation \Auth \ThrottlesLogins ;
6+ use Illuminate \Foundation \Auth \RegistersUsers ;
97use Validator ;
108
11- class AuthController extends Controller
9+ class RegisterController extends Controller
1210{
1311 /*
1412 |--------------------------------------------------------------------------
15- | Registration & Login Controller
13+ | Register Controller
1614 |--------------------------------------------------------------------------
1715 |
18- | This controller handles the registration of new users, as well as the
19- | authentication of existing users . By default, this controller uses
20- | a simple trait to add these behaviors. Why don't you explore it?
16+ | This controller handles the registration of new users as well as their
17+ | validation and creation . By default this controller uses a trait to
18+ | provide this functionality without requiring any additional code.
2119 |
2220 */
23-
24- use AuthenticatesAndRegistersUsers, ThrottlesLogins;
21+ use RegistersUsers;
2522
2623 /**
24+ * Where to redirect users after login / registration.
25+ *
2726 * @var string
2827 */
29- protected $ redirectPath = '' ;
28+ protected $ redirectTo = '/ ' ;
3029
3130 /**
32- * Create a new authentication controller instance.
31+ * Create a new controller instance.
3332 *
3433 * @return void
3534 */
3635 public function __construct ()
3736 {
38- $ this ->middleware ('guest ' , [ ' except ' => ' getLogout ' ] );
37+ $ this ->middleware ('guest ' );
3938 }
4039
4140 /**
@@ -49,7 +48,7 @@ protected function validator(array $data)
4948 return Validator::make ($ data , [
5049 'name ' => 'required|max:255 ' ,
5150 'email ' => 'required|email|max:255|unique:users ' ,
52- 'password ' => 'required|confirmed| min:6 ' ,
51+ 'password ' => 'required|min:6|confirmed ' ,
5352 ]);
5453 }
5554
@@ -67,4 +66,4 @@ protected function create(array $data)
6766 'password ' => bcrypt ($ data ['password ' ]),
6867 ]);
6968 }
70- }
69+ }
0 commit comments