Login

You have the option to log in using the email and password. You will be prompted to this page when trying to access any page on the website while not being logged in.

The App\Http\Controllers\ProfileController handles the update of the user information and password.


                    /**
                    * Where to redirect users after login.
                    *
                    * @var string
                    */
                   protected $redirectTo = '/dashboard';
               
                   /**
                    * Create a new controller instance.
                    *
                    * @return void
                    */
                   public function __construct()
                   {
                       $this->middleware('guest')->except('logout');
                   }
            

If you input the wrong data when editing the profile, don`t worry. Validation rules have been added to prevent this (see App\Http\Requests\UserRequest).


                    public function rules()
                    {
                        return [
                            'name' => [
                                'required', 'min:3'
                            ],
                            'email' => [
                                'required', 'email', Rule::unique((new User)->getTable())->ignore($this->route()->user->id ?? null)
                            ],
                            'role_id' => [
                                'required', 'exists:'.(new Role)->getTable().',id'
                            ],
                            'password' => [
                                $this->route()->user ? 'required_with:password_confirmation' : 'required', 'nullable', 'confirmed', 'min:6'
                            ],
                        ];
                    }