This project is a RESTful API for a Hotel Booking System. It is designed to manage hotel rooms, bookings, customer interactions, and payment records.
- PHP >= 7.3
- Composer
- Laravel >= 8.x
- MySQL or any Laravel-supported database system
-
Clone the repository:
git clone https://github.com/Don404/hotelbooking-chocolate.git
-
Navigate to the project directory:
cd hotelbooking-chocolate
-
Install dependencies:
composer install
-
Create a
.env
file and configure your environment variables (especially the database settings). -
Generate an application key:
php artisan key:generate
-
Run database migrations:
php artisan migrate
-
(Optional) Seed the database:
php artisan db:seed
-
Start the local development server:
php artisan serve
The base URL for the API is http://localhost:8000/api
.
This API uses token-based authentication. Include the token in the header of your requests:
Authorization: Bearer YOUR_API_TOKEN
- GET /rooms: List all rooms.
- POST /rooms: Create a new room.
- GET /rooms/{id}: Get details of a specific room.
- POST /bookings: Create a new booking.
- GET /bookings: List all bookings.
- POST /customers: Add a new customer.
- GET /customers: List all customers.
- POST /payments: Record a new payment.
- Andon Grozev - Initial work