Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function auth(array $options = [])
- {
- // Authentication Routes...
- $this->get('admin/login', 'AuthLoginController@showLoginForm')->name('login');
- $this->post('admin/login', 'AuthLoginController@login');
- $this->post('admin/logout', 'AuthLoginController@logout')->name('logout');
- // Registration Routes...
- if ($options['register'] ?? true) {
- $this->get('admin/register', 'AuthRegisterController@showRegistrationForm')->name('register');
- $this->post('admin/register', 'AuthRegisterController@register');
- }
- // Password Reset Routes...
- if ($options['reset'] ?? true) {
- $this->resetPassword();
- }
- // Email Verification Routes...
- if ($options['verify'] ?? false) {
- $this->emailVerification();
- }
- }
- use RegistersUsers;
- /**
- * Where to redirect users after registration.
- *
- * @var string
- */
- protected $redirectTo = '/admin/inicio';
- /**
- * Create a new controller instance.
- *
- * @return void
- */
- public function __construct()
- {
- $this->middleware('auth');
- }
- /**
- * Get a validator for an incoming registration request.
- *
- * @param array $data
- * @return IlluminateContractsValidationValidator
- */
- protected function validator(array $data)
- {
- return Validator::make($data, [
- 'name' => ['required', 'string', 'max:255'],
- 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
- 'password' => ['required', 'string', 'min:6', 'confirmed'],
- ]);
- }
- /**
- * Create a new user instance after a valid registration.
- *
- * @param array $data
- * @return AppUser
- */
- protected function create(array $data)
- {
- return User::create([
- 'role' => 'helper',
- 'name' => $data['name'],
- 'nick' => 'default',
- 'email' => $data['email'],
- 'password' => Hash::make($data['password']),
- ]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement