12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace App\Http\Controllers\Auth;
- use App\User;
- use Validator;
- use App\Http\Controllers\Controller;
- use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
- class AuthController extends Controller
- {
-
- use AuthenticatesAndRegistersUsers;
-
- public function __construct()
- {
- $this->middleware('guest', ['except' => 'getLogout']);
- }
-
- protected function validator(array $data)
- {
- return Validator::make($data, [
- 'name' => 'required|max:255',
- 'email' => 'required|email|max:255|unique:users',
- 'password' => 'required|confirmed|min:6',
- ]);
- }
-
- protected function create(array $data)
- {
- return User::create([
- 'name' => $data['name'],
- 'email' => $data['email'],
- 'password' => bcrypt($data['password']),
- ]);
- }
- }
|