Skip to content

TechnourceDeveloper/Technource-Laravel-API-Code-Sample

Repository files navigation

Technource Sample Laravel API Code

This is a code sample from one of our projects for review. APIs are developed in Laravel.

Installation

PHP 8.1 Larave 9.44

  1. Clone bitbucket
   git clone https://github.com/TechnourceDeveloper/TC-review-source-web-api.git
  1. Install dependency
   composer install
  1. Copy .env.example and create .env file
   sudo cp .env.example .env
  1. Generate a new application key
   php artisan key:generate
  1. Environment variables in .env

For update .env file using cmd use below command

   sudo nano .env

Set below varibale for database connection with your database

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

Set below varibale for SMTP connection for send email

   MAIL_MAILER=smtp

   MAIL_HOST=mailhog

   MAIL_PORT=1025

   MAIL_USERNAME=null

   MAIL_PASSWORD=null

   MAIL_ENCRYPTION=null

   MAIL_FROM_ADDRESS=null

   MAIL_FROM_NAME="${APP_NAME}"
  1. Migrate and seed database with tablses and predefined data
   php artisan migrate:fresh --seed
  1. Generate symlink
   php artisan storage:link
  1. Start the local development server
   php artisan serve   

You can now access the server at http://localhost:8000 Testing API The api can now be accessed at

   http://localhost:8000/api/v1

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published