- Install Laravel (https://laravel.com/docs/5.1#installation)
- Install Vagrant (https://www.vagrantup.com/)
- Install VirtualBox (https://www.virtualbox.org/wiki/Downloads)
git clone [email protected]:kodeflex/laravel-test.git
cd laravel-test
Run npm i
composer install
runs in background as apreinstall
npm script
- Run
npm start
- Run
npm run vagrant:init:<mac|win>
command to initialize the devleopment environment - Run
npm run vagrant
orvagrant up
- Run
npm run vagrant:destroy
orvagrant destroy
to destroy the Vagrant env.
php artisan migrate
php artisan db:seed
Using
laravel/passport
See routes/api.php
for sample routes.
php artisan passport:client [--personal|--passowrd]
POST <your-ip-or-domain>/oauth/token
request-body
{
"client_id": "<client-id>",
"client_secret": "<client_secret>",
"grant_type": "password",
"scope": "*",
"username": "<email>",
"password": "<password>"
}
response
{
"token_type": "Bearer",
"expires_in": 31535999,
"access_token": "<access_token>"
}
GET /api/v1/users HTTP/1.1
Host: host-ip
Accept: application/json
Authorization: Bearer <access_token>
Cache-Control: no-cache