Laravel API with Passport Token Authentication
This is the fastest way to deploy a laravel API app with passport and token.
Tihs was tested from an Ubuntu 20.04TLS virtual Machine with Windows 10 Host as of February 15, 2021.
Requirements:
Ok, here is the command and the instruction. Very simple:
First Command:
1. $ curl -s https://www.webune.com/forums/web/img/webune-com/202102/15-p4925-api.txt | bash
or
2. $ bash <(curl -s https://www.webune.com/forums/web/img/webune-com/202106/06-p4925-apiv2.txt)
Note: 2 is the preferred way. Sometimes you may not get any response due to network connectivity problems, just keep trying by sending the command again. But as of June 6, 2021, the command works.
# mysql --password= --execute="create database [DB_BAME];"
API TESTING:
You can use your favorite API Development application like Postman or Imsomnia for example
1. Creat User
POST: http://localhost/api/register
email: [email protected]
password: example123
2. Login user
POST: http://localhost/api/login
email: [email protected]
password: example123
NOTE: TOKEN
3. Create CEO
POST: http://localhost/api/ceo
name: Steve Jobs
year: 2021
company_headquarters: cupertino
what_company_does: phones
company_name: apple
Provide TOKEN from step 2
Other endpoints:
For more details you go visit the repository:
https://github.com/edwinaquino/laravel-backend-api