GithubHelp home page GithubHelp logo

laracrud's Introduction

Laravel Logo

About project

It's a simple API request/response CRUD application made with Laravel.

Features

Method Name API call Response Note
POST User Registration api/register Success Require json body
POST Login api/login Authentication token Require json body
POST Add product api/products Created product Require authentication key & json body
GET Show all products api/products All products Requires nothing
GET Get specific product api/products/1 Returns product of id 1 (if exists) Requires nothing
PUT Update product api/products/1 Returns updated product of id 1 (if exists) Require authentication key & json body
DELETE Delete product api/products/1 Delete product of id 1 (if exists) Require authentication key
POST Logout api/logout Logout of the system Require authentication key

Accepted/Required json keys

Registration: name, email, password, password_confirmation
Login: email, password
Add products: name, slug, description, price
Update products: name, description, price [Note: not all the field is required here]

Postman configuration

Download and install the Postman desktop application. Create a new collection then create a new global variable token for authorization. Initialize the variable with the token from the response of login. Now navigate to the API request window, search for Authorization tab; Select type Bearer Token and set the token in the Token field. [NOTE: global variable token must be reinitialized with the new token value from the response of login every time after logout.]

  • Set Headers to accept application/json and use x-www-form-urlencoded where needed for convenience.

Installation

Your machine must have composer, php, xampp, git, node installed.

Step 1: Clone the repository/Download ZIP

https://github.com/rezabtuhin/laracrud.git

Step 2: Navigate to the project directory on your desktop.

Step 3: Open the terminal and run these commands (Requires all commands).

composer install
npm install
cp .env.example .env

Set up the database in the .env file and your MySQL server and configurations. Then run-

php artisan key:generate
php artisan migrate
php artisan serve

Sample postman config file: Download here.

Good luck ๐Ÿ˜ƒ

laracrud's People

Contributors

rezabtuhin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.