This Laravel-based booking API provides a comprehensive solution for managing properties, apartments, and bookings, similar to the Booking.com API. It allows property owners to effortlessly manage their listings, while users can seamlessly search and book accommodations.
- Search capabilities: Enabling users to search for properties and apartments based on various criteria, including location, price, amenities, and availability.
- Property Management: Create, update, and manage property details, including photos, descriptions, and amenities.
- Apartment Management: Add, edit, and manage individual apartments within each property, including rooms, rates, and availability.
- Booking Management: Facilitate user searches for available accommodations, and process bookings.
- Authentication and Authorization: Implement robust authentication and authorization mechanisms to ensure secure access to property management features.
- Laravel framework
- PHP >= 8
- Database (MySQL, PostgreSQL, etc.)
- Clone the repository
- Install dependencies:
composer install
- Configure database connection in
.env
- Migrate and seed database tables:
php artisan migrate --seed
/api/v1
Endpoint | Method | Parameters |
---|---|---|
/register |
POST |
name, email, password, role_id (Owner/User) |
/login |
POST |
email, password |
Endpoint | Method | Description |
---|---|---|
/user/bookings |
POST |
Create booking |
/user/bookings |
GET |
View bookings |
/user/bookings/{booking_id} |
GET |
View booking |
/user/bookings/{booking_id} |
PUT |
Update booking |
/user/bookings/{booking_id}/cancel |
PUT |
Cancel booking |
Endpoint | Method | Description |
---|---|---|
/owner/properties |
POST |
Create property |
/owner/properties |
GET |
View properties |
/owner/properties/{property_id} |
GET |
View property |
/owner/properties/{property_id} |
PUT |
Update property |
/owner/properties/{property_id}/deactivate |
PUT |
Deactivate property |
/owner/properties/{property_id}/activate |
PUT |
Activate property |
/owner/properties/{property_id}/photos |
POST |
Store property photos |
/owner/properties/{property_id}/photos/{photo_id}/reorder |
PUT |
Update photo's order |
Endpoint | Method | Description |
---|---|---|
/owner/properties/{property_id}/apartments |
GET |
View property's apartments |
/owner/properties/{property_id}/apartments |
POST |
Create apartment |
/owner/properties/{property_id}/apartments/{apartment_id} |
GET |
View apartment |
/owner/properties/{property_id}/apartments/{apartment_id}/bookings |
GET |
View apartment bookings |
/owner/properties/{property_id}/apartments/{apartment_id} |
PUT |
Update apartment |
/owner/properties/{property_id}/apartments/{apartment_id}/deactivate |
PUT |
Diactivate apartment |
/owner/properties/{property_id}/apartments/{apartment_id}/activate |
PUT |
Activate apartment |
Endpoint | Method | Description |
---|---|---|
/owner/properties/{property_id}/apartments/{apartment_id}/prices |
GET |
View apartment availability prices |
/owner/properties/{property_id}/apartments/{apartment_id}/prices |
POST |
Create apartment price |
/owner/properties/{property_id}/apartments/{apartment_id}/prices/{price_id} |
GET |
View apartment price |
/owner/properties/{property_id}/apartments/{apartment_id}/prices/{price_id} |
PUT |
Update apartment price |
/owner/properties/{property_id}/apartments/{apartment_id}/prices/{price_id} |
DELETE |
Delete apartment price |
Endpoint | Method | Description | Optional Parameters |
---|---|---|---|
/search |
GET |
Search properties and apartments | city_id, country_id, geoobject_id, adult_capacity, children_capacity, price_from, price_to, facilities |
/apartments/view/{apartment_id} |
GET |
View apartment | |
/properties/view/{property_id} |
GET |
View property |
To run tests, run the following command
php artisan test
Deploy to any web server that supports PHP
Contributing is always welcomed