How to create new microservices in Laravel framework

Step1- Open command prompt or Git Bash on xampp/htdocs directory

Step2- Create Laravel New Project write this command

composer create-project –prefer-dist laravel/laravel scmgalaxy “5.5.*”

Step3- Move to project directory on git bash

cd scmgalaxy

Step4- Project directory on git bash on this command

composer require laravel/passport

Step5- Create Database in Mysql Server

Step5- Set Mysql Server Username ,Password and Database Name in .env file

DB_DATABASE=microservices DB_USERNAME=root DB_PASSWORD=

Step6-scmgalaxy\app\user.php add in user model this code

use Laravel\Passport\HasApiTokens; use HasApiTokens, Notifiable;

Step8- scmgalaxy\app\Providers\AppServiceProvider add in this code

use Laravel\Passport\Passport;

Step8- config\auth.php add in this code

‘api’ => [ ‘driver’ => ‘passport’, ‘provider’ => ‘users’, ],

Step9- scmgalaxy\app\Http\Kernel.php add this code

‘client_credentials’ => \Laravel\Passport\Http\Middleware\CheckClientCredentials::class,

Step9- scmgalaxy\config\app.php add this code

Laravel\Passport\PassportServiceProvider::class,

Step10- Project directory on git bash on this command

composer update

Step11- Project directory on git bash on this command

php artisan make:auth

Step12- Project directory on git bash on this command

php artisan migrate

Step13- Project directory on git bash on this command

php artisan passport:install
dharmendra K

Leave a Reply