Skip to content

danielvogog/Laravel_API

Repository files navigation

Laravel API

A simple Laravel API.

Installation

  1. Clone the repository
git clone https://github.com/danielgogov-github/Laravel_API.git
  1. Install all composer packages
composer install
  1. Copy .env
cp .env.example .env
  1. Set database, database username and database password
DB_DATABASE=laravel_api
DB_USERNAME=username
DB_PASSWORD=password
  1. Generate application key
php artisan key:generate
  1. Do migration
php artisan migrate
  1. Fill the table with data
php artisan db:seed
  1. Run the web server
php artisan serve

Features

  1. Show all products
  2. Show a single product
  3. Create a new product
  4. Edit a product
  5. Delete a product

API Endpoints

Method Route Description
GET /api View all products
GET /api/{id} View a single product
POST /api Create a new product
PUT /api/update/{id} Update a product
DELETE /api/destroy/{id} Delete a product

Screenshots

View all products View all products

View a single product View a single product

Create a new product Create a new product

Update a product Update a product

Delete a product Delete a product

About

A simple Laravel API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published