Login system
Now that we have our user model created, we can implement the rest of the login system. Again, Laravel includes this as an out-of-the-box feature, so there is only a small amount of configuration for us to do.
Here's an overview of how the login system works:
- The user provides their email and password in a login form. We'll create this form with Vue
- The form is submitted to theÂ
/login
 POST route - TheÂ
LoginController
 will then verify the user's credentials against the database
Â
- If the login is successful, the user is redirected to the home page. A session cookie is attached to the response, which is then passed to all outgoing requests to verify the user
Here's a diagrammatic representation of the login system for further clarity:
Figure 9.1. Login flow
LoginPage component
We will need a login page for our app, so let's create a new page component:
$ touch resources/assets/components/LoginPage.vue
We'll begin by defining the template markup, which includes a form with fields for email and...