🐰
Pet Store API
🐾
🐙
Project
Petstore is a sample API that simulates a pet shop management server. The API allows you to access Petstore data using a set of individual calls
🐋
To get started
- Run
git clone https://github.com/WilmerRS/pet-store-api.git
. - Run
composer install
- Run
cp .env.example .env
or copy.env.example
.env
- Run
php artisan key:generate
- Run
php artisan migrate
- Run
php artisan db:seed
- Run
php artisan serve
- Run
php artisan storage:link
- Enjoy!
🎊
🐣
Features
- Authentication and Authorization
- Roles by user
- Create and get operations for users
- Create, Search, Update and Get all operations for pets
- CRUD operations for categories
- CRUD operations for status
- Pictures for pets and image treatment
🐻❄️
HTTP Schema
🐈⬛
Pet
GET
/pets
/pets?paginated=10&page=1
/pets?category_id=1&status_id=1
GET /pets
{
"code": 200,
"message": "Pets retrieved successfully.",
"data": {
"pet": [
{
...
"category": {
...
},
"status": {
...
}
}
]
}
}
GET
/pets/{pet-slug}
GET /pets/my-dog
{
"code": 200,
"message": "Pet retrieved successfully.",
"data": {
"pet": {
...
"category": {
...
},
"status": {
...
}
}
}
}
POST
/pets
POST /pets
{
"name": "name3",
"slug": "slug4",
"description":" description",
"category_id": 1,
"status_id": 1
}
PATCH
/pets
PATCH /pets
{
"name": "name3",
"description":" description",
...
}
🗄️
Models
🐈⬛
Pet
Pet = {
id: string,
name: string,
category: Category,
status: Status,
is_active: string,
created_at: date,
updated_at: date,
}