Giter Club home page Giter Club logo

laravel-api's Introduction

Book RESTful API with Laravel πŸ“šπŸš€

This project is a simple RESTful API built using Laravel for managing a book. It includes features for creating, retrieving, updating, and deleting books.

Getting Started πŸ› οΈ

Follow these steps to run the project locally:

  1. Set Up the Database:

    Make sure you have a MySQL database set up. Update the .env file with your database connection details.

  2. Run Migrations:

    php artisan migrate
  3. Seed the Database:

    php artisan db:seed --class=BookSeeder
  4. Start the Development Server:

    php artisan serve

The server will start at http://localhost:8000.

API Endpoints πŸšͺ

Get All Books

  • Endpoint: GET /api/book
  • Description: Retrieve a list of all books.

Get Book by ID

  • Endpoint: GET /api/book/{id}
  • Description: Retrieve a specific book by ID.

Create Book

  • Endpoint: POST /api/book
  • Description: Create a new book.

Update Book by ID

  • Endpoint: PUT /api/book/{id}
  • Description: Update a specific book by ID.

Delete Book by ID

  • Endpoint: DELETE /api/book/{id}
  • Description: Delete a specific book by ID.

The API Postman Collection is available in the /postman-collection/ directory.

Database Schema πŸ—„οΈ

The database schema includes the following table:

  • Table Name: books
    • id: Auto-incremental primary key
    • title: Title of the book (string)
    • author: Author of the book (string)
    • published_date: Published date of the book (date)
    • created_at and updated_at: Timestamps for creation and last update

Closing NotesπŸ“

If you find any issues or have suggestions for improvement, please feel free to open an issue or submit a pull request.

Happy coding!πŸš€πŸ‘¨β€πŸ’»

laravel-api's People

Contributors

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