Switch to the project folder
cd project-folder
Install all the dependencies using composer
composer install
Run the database migrations (Set the database connection in .env before migrating)
php artisan migrate
Run the documentation generate
php artisan swagger-lume:generate
Set auth service base url in config/services.php
'users' => [
'base_uri' => 'localhost:8001',
'secret' => '',
],
'teams' => [
'base_uri' => 'localhost:8002',
'secret' => '',
],
'subscriptions' => [
'base_uri' => 'localhost:8003',
'secret' => '',
],
You can now access the docs at http://localhost:8000/api/documentation
Start the local development server
php -S localhost:8000 -t public/
You can now access the server at http://localhost:8000
TL;DR command list
composer install
php artisan migrate
php artisan swagger-lume:generate
Make sure you set the correct database connection information before running the migrations Environment variables
- darkaonline/swagger-lume - For generate docs for api
app
- Contains all the Eloquent modelsapp/Http/Controllers
- Contains all the api controllersapp/Http/Middleware
- Contains the JWT auth middlewareconfig
- Contains all the application configuration filesdatabase/factories
- Contains the model factory for all the modelsdatabase/migrations
- Contains all the database migrationsdatabase/seeds
- Contains the database seederroutes
- Contains all the api routes defined in web.php filetests
- Contains all the application tests
.env
- Environment variables can be set in this file
Note : You can quickly set the database information and other variables in this file and have the application fully working.
Run the laravel development server
php -S localhost:8000 -t public/
The api can now be accessed at
http://localhost:8000
Request headers
Required | Key | Value |
---|---|---|
Optional | Content-Type | application/json |