Getting started
- Clone repo
- Composer install
- run command to create db
php artisan database:create
- run
php artisan migrate:install
- run
php artisan migrate
- run
php artisan db:seed
to seed data - run
php artisan serve
CAR Endpoints
GET
http://127.0.0.1:8000/api/cars
http://127.0.0.1:8000/api/cars/1
GET FILTERS
http://127.0.0.1:8000/api/cars?brand=teal
http://127.0.0.1:8000/api/cars?color=teal
POST
http://127.0.0.1:8000/api/cars
{
"name": "Corbin",
"color": "LightYellow",
"brand": 1
}
PATCH
http://127.0.0.1:8000/api/cars/1
{
"color": "LightYellow",
"brand": 1
}
DELETE
http://127.0.0.1:8000/api/cars/1
CARBRAND Endpoints
GET
http://127.0.0.1:8000/api/car-brands
http://127.0.0.1:8000/api/car-brands/1
POST
http://127.0.0.1:8000/api/car-brands
{
"name": "Corbin",
"description": "nice mane nice"
}
PATCH
http://127.0.0.1:8000/api/car-brands/1
{
"description": "llasaow"
}
DELETE
http://127.0.0.1:8000/api/car-brands/1
UPLOAD IMAGE
curl --location --request POST 'http://127.0.0.1:8000/api/car-image' \
--header 'Accept: application/json' \
--form 'description="carimages"' \
--form 'car="2"' \
--form 'file=@"/home/adil/Pictures/DK/download.jpeg"'