1 | <?php |
||
13 | class AuthController extends Controller |
||
14 | { |
||
15 | /* |
||
16 | |-------------------------------------------------------------------------- |
||
17 | | Registration & Login Controller |
||
18 | |-------------------------------------------------------------------------- |
||
19 | | |
||
20 | | This controller handles the registration of new users, as well as the |
||
21 | | authentication of existing users. By default, this controller uses |
||
22 | | a simple trait to add these behaviors. Why don't you explore it? |
||
23 | | |
||
24 | */ |
||
25 | |||
26 | use AuthenticatesAndRegistersUsers, ThrottlesLogins; |
||
27 | |||
28 | /** |
||
29 | * Where to redirect users after login / registration. |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $redirectTo = '/'; |
||
34 | |||
35 | /** |
||
36 | * Create a new authentication controller instance. |
||
37 | * @codeCoverageIgnore |
||
38 | * |
||
39 | * @return void |
||
|
|||
40 | */ |
||
41 | public function __construct() |
||
46 | |||
47 | /** |
||
48 | * Get a validator for an incoming registration request. |
||
49 | * |
||
50 | * @param array $data |
||
51 | * @return \Illuminate\Contracts\Validation\Validator |
||
52 | */ |
||
53 | protected function validator(array $data) |
||
54 | { |
||
55 | return Validator::make($data, [ |
||
56 | 'name' => 'required|max:255', |
||
57 | 'username' => 'required|max:255|unique:users', |
||
58 | 'email' => 'required|email|max:255|unique:users', |
||
59 | 'password' => 'required|min:6|confirmed', |
||
60 | ]); |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * Create a new user instance after a valid registration. |
||
65 | * |
||
66 | * @codeCoverageIgnore |
||
67 | * |
||
68 | * @param array $data |
||
69 | * @return User |
||
70 | */ |
||
71 | public function create(array $data) |
||
83 | |||
84 | /** |
||
85 | * Redirect the user to the authentication service. |
||
86 | * |
||
87 | * @codeCoverageIgnore |
||
88 | * |
||
89 | * @return Response |
||
90 | */ |
||
91 | public function redirectToProvider($provider) |
||
95 | |||
96 | /** |
||
97 | * Obtain the user information from authentication service. |
||
98 | * |
||
99 | * @codeCoverageIgnore |
||
100 | * |
||
101 | * @return Response |
||
102 | */ |
||
103 | public function handleProviderCallback($provider) |
||
110 | } |
||
111 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.