In short, this is a direct replacement of the php artisan make:auth
command with laravel but with Vue and Bulma
- Laravel: Acts as the back-end API
- Passport: Handles API auth and allows for oAuth support. Current version uses the CreateFreshApiToken middleware to set a JWT in the encrypted cookie that gets sent with the responses. (This SPA is not decoupled as it is launched via a blade)
- Vue: Acts as the front end framework
- Vuex: Vue plugin to handle state management for the app
- vue-router: Handles the routing, currently it does not handle history mode since it requires server changes but if you don't want the hashes just look at this
- Buefy: just a Vue version of Bulma to make things a little more simple by having components... you don't need it but i liked it.
- LocalForage: Simple enhancement for local storage, it uses promises so made my life easier...
I wanted to learn Vue (and improve my understanding of JS) and create a SPA with Laravel that utilized oAuth.
As I was working on this I realized this would be helpful for me with my future projects so i don't have to do the boring stuff over and over again. Then I figured I'd share it, enjoy.
Just in-case you are new to the world of Laravel...
- Clone this repo
- copy
env.example
to.env
- fill out the
.env
to meet your requirements - run
composer install
- run
php artisan key:generate
- run
php artisan migrate
- run
php artisan passport:install
- visit site