Rest api development with lumen – part 1 : Environment setup

Rest api development with lumen – part 1 : Environment setup

Step 1 :

Open command line tool or terminal for mac/ linux  and run this command for lumen installer . If you have not composer installed then download and install it from here ; https://getcomposer.org/

composer global require "laravel/lumen-installer"

Step 2 : 
 Create a lumen project with following command 
 composer create-project --prefer-dist laravel/lumen restapi

Step 3 : 
    Go the project directory and run the project 

    php -S localhost:8000 -t public
    


Step 4 : Database file setup . Open .env file and setup database file . For mysql it looks like - 
If you have no database create database for localhost . You need to install XAMP/WAMP .
APP_ENV=local
APP_DEBUG=true
APP_KEY=
APP_TIMEZONE=UTC

LOG_CHANNEL=stack
LOG_SLACK_WEBHOOK_URL=

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=lumen_api
DB_USERNAME=root
DB_PASSWORD=

CACHE_DRIVER=file
QUEUE_DRIVER=sync


change the database name , password and username . 


And Environment and database setup done .  

   


Leave a Reply

Your email address will not be published. Required fields are marked *