1. Install Laravel, nuxt.js and Bulma
php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"
php artisan make:controller Auth\\RegisterController
- Aller sur POST |
/api/register
dans Postman (avec Accept: Application/json) en mettant les paramètres (email, name, password) dans Body
php artisan make:controller Auth\\LoginController
- Aller sur POST |
/api/login
dans Postman (avec Accept: Application/json) en mettant les paramètres (email, password) dans Body
php artisan make:resource UserResource
- Modifier dans Postman "Authorization" et mettre Bearer
- Aller sur GET |
/api/me
dans Postman (avec Accept: Application/json) en mettant le paramètre (token) dans Body
npm install @nuxtjs/auth @nuxtjs/axios
- Create route in routes/api.php
php artisan make:controller Auth\\LogoutController
- create store/validation.js
- create plugins/axios.js
- add plugin in nuxt.config.js
- create plugins/mixins/validation.js
- create middleware/clearValidationErrors.js
- add middleware in nuxt.config.js
11. Auth/guest middleware
- create dashboard.vue
- add redirect in nuxt.config.js
- create middleware/guest.js
- add middleware in nuxt.config.js