Giter VIP home page Giter VIP logo

esetter's Introduction

HereInAfter Library API Documentation

Setup and Run Locally

To run this project locally, follow the steps below:

  1. Clone the repository:

    git clone https://github.com/your-username/hereinafter-library.git

  2. Navigate to the project directory:

    cd hereinafter-library

  3. Install dependencies:

    composer install

  4. Create a copy of the .env.example file and rename it to .env:

    cp .env.example .env
  5. Generate an application key:

    php artisan key:generate
  6. Configure your database settings in the .env file.

  7. Run database migrations:

    php artisan migrate
  8. Seed the database (if needed):

    php artisan db:seed
  9. Start the development server:

    php artisan serve
  10. The API will be available at http://127.0.0.1:8000 by default.

API Endpoints

Delete Book

Delete a book from the library.

Request

  • URL: http://127.0.0.1:7600/api/book/2
  • Method: DELETE
  • Authorization: Bearer Token
  • Token: <token>

Response

  • Status: 204 No Content

Get User Token

Get the user token for authentication.

Request

  • URL: http://127.0.0.1:7600/api/test/get-token/6
  • Method: GET

Response

  • Status: 200 OK
  • Body: <token>

Add Book

Add a new book to the library.

Request

  • URL: http://127.0.0.1:7600/api/book
  • Method: POST
  • Authorization: Bearer Token
  • Token: <token>
  • Body: form-data
    • name: Test Book 3
    • author_ids: 5,7

Response

  • Status: 201 Created
  • Body: JSON representation of the newly created book

Modify Book

Modify details of a book in the library.

Request

  • URL: http://127.0.0.1:7600/api/book/3
  • Method: PUT
  • Authorization: Bearer Token
  • Token: <token>
  • Query Params:
    • name: Test

Response

  • Status: 200 OK
  • Body: JSON representation of the modified book

esetter's People

Contributors

abrarprogrammer 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.