Git Product home page Git Product logo

test28's Introduction

Installation:

Install composer dependencies

composer install

Create and configure the .env file based on .env.example

Run migrations: :fresh is optional

php artisan migrate:fresh

Seed the DB with temporarily dev data:

php artisan db:seed

Run the built-in server or configure external web server

php artisan serve

API:

Every request uses prefix /api

Authorization

POST /auth/login

Request (seeded user):

{
    "username": "admin",
    "password": "password"
}

Manufacturers CRUD:

Operation Request Type
Get /manufacturers/{id} GET
List /manufacturers GET
Create /manufacturers POST
Update /manufacturers/{id} UPDATE
Delete /manufacturers/{id} DELETE

Create and update manufacturer body request example:

{
    "name": "manufacturer #2"
}

Car Models CRUD:

Operation Request Type
Get /models/{id} GET
List /models GET
Create /models POST
Update /models/{id} UPDATE
Delete /models/{id} DELETE

Create and update car model body request example:

{
    "name": "model #3",
    "manufacturer_id": 2
}

Cars CRUD:

Operation Request Type
Get /cars/{id} GET
List /cars GET
Create /cars POST
Update /cars/{id} UPDATE
Delete /cars/{id} DELETE

Create and update car body request example:

{
    "manufacturer_id": 2,
    "model_id": 3,
    "release_year": "2024",
    "mileage": 1,
    "color": "red"
}

User's favorites list:

There are 2 approaches how user's favorite cars could be listed: through user's direct model relation (V1) or through repository class via eloquent query builder (V2)

Operation Request Type
List V1 /users/favorites/v1 GET
List V2 /users/favorites/v2 GET
Manage list /users/favorites POST
Manage list body request example:
{
    "cars": [
        {
            "id": 1
        },
        {
            "id": 3
        }
    ]
}

test28's People

Contributors

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