Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pktharindu/nuxt-laravel-passport-example
Nuxt.js app as a first-party client powered by Laravel Passport API
https://github.com/pktharindu/nuxt-laravel-passport-example
api authentication client hacktoberfest laravel laravel-passport laravel-ui nuxt nuxtjs passport password-grant
Last synced: 17 days ago
JSON representation
Nuxt.js app as a first-party client powered by Laravel Passport API
- Host: GitHub
- URL: https://github.com/pktharindu/nuxt-laravel-passport-example
- Owner: pktharindu
- License: mit
- Created: 2019-01-07T10:08:09.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-09-20T11:46:20.000Z (about 2 years ago)
- Last Synced: 2024-10-04T11:54:03.702Z (about 1 month ago)
- Topics: api, authentication, client, hacktoberfest, laravel, laravel-passport, laravel-ui, nuxt, nuxtjs, passport, password-grant
- Language: PHP
- Homepage:
- Size: 1.8 MB
- Stars: 67
- Watchers: 6
- Forks: 29
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> This example implements Nuxt app as a first-party client and Laravel Passport as the backend API. It supports Passport-password grant out of the box which allows your other first-party clients, such as a mobile application, to obtain an access token using an e-mail address and password. But feel free to use other grant types in _laravel/passport_ by extending this.
## Installation
Clone the repository
git clone https://github.com/pktharindu/nuxt-laravel-passport-example.git
Switch to the laravel folder first
cd nuxt-laravel-passport-example/laravel
Install all the dependencies using composer
composer install
Copy the example env file and make the required configuration changes in the .env file
cp .env.example .env
Generate a new application key
php artisan key:generate
Run the database migrations (**Set the database connection in .env before migrating**)
php artisan migrate
Install passport
php artisan passport:install
Start the local development server
php artisan serve
You can now access the server at http://localhost:8000
Switch to the nuxt folder next
cd ../nuxt/
Install all the dependencies using npm
npm install
Copy the example env file and populate it with values from laravel
cp .env.example .env
You can get `PASSPORT_PASSWORD_GRANT_ID` and `PASSPORT_PASSWORD_GRANT_SECRET` with `php artisan passport:client --password`.
serve with hot reload at localhost:3000
yarn run dev