-
Install dependencies
composer install
-
Use .env.example file as template and save as .env file. Here configure database connection and app URL.
-
Install Homestead
Mac/Linux:
php vendor/bin/homestead make
Windows:
//vendor//bin//homestead make
-
Create host address for project, edit hosts file (will need admin rights):
Mac/Linux:
nano /etc/hosts
Windows:
C:\Windows\System32\drivers\etc\hosts
-
Generate application key
php artisan key:generate
-
Generate JWTAuth secret key for token signing:
php artisan jwt:secret
-
Create and run Homestead virtual machine
vagrant up
-
After virtual machine is running, run migrations
php artisan migrate
-
Now the Demo is ready for use, try:
To register a user:URL: <Host>/api/register Data: { "name" : "User One", "email: : [email protected]", "password" : "123456", "password_confirmed" : "123456" }
To login user:
URL: <Host>/api/login Data: { "email: : [email protected]", "password" : "123456" }
mxlopez25 / laravelauthenticationdemo Goto Github PK
View Code? Open in Web Editor NEWLaravel basic API example of authentication using JWT (1.0.0.rc-3)