This is a PHP-based car rental application that follows the MVC (Model-View-Controller) architecture. It is designed to provide functionality for managing vehicles, rentals, payments, and maintenance while ensuring a clean, structured, and scalable codebase.
- User Authentication: Login and registration for customers and admin.
- Role Management: Separate functionalities for customers and admin.
- Vehicle Management: Admin can add, update, or remove vehicles and track their status (available, rented, maintenance).
- Rental Management: Users can rent vehicles and view their rental history.
- Payment Processing: Secure payment handling with different statuses (pending, completed).
- Maintenance Tracking: Admin can log and manage vehicle maintenance records.
- Responsive Design: Designed to work seamlessly across different devices.
- PHP Native: Core development without a framework, adhering to the MVC pattern.
- PDO: Database operations with prepared statements for security and performance.
- HTML/CSS/JS: Frontend development with responsive design in mind.
- Composer: Dependency management (if needed).
- MySQL: Relational database for storing application data.
- Laragon: Local development environment.
/project_root
├── /app
│ ├── /Controllers
│ ├── /Models
│ ├── /Views
│ ├── /Services
├── /config
├── /core
├── /public
│ ├── /css
│ ├── /js
│ ├── /images
├── .env
├── composer.json
├── README.md
/app
: Contains the application logic (Controllers, Models, Views)./config
: Configuration files for database and routing./core
: Core classes likeApp
(router) andDatabase
./public
: Public-facing assets like CSS, JS, and images.
Follow these steps to set up the project with Laragon, a lightweight development environment for PHP.
git clone https://github.com/your-username/rental-car-application.git
- Locate the Laragon installation directory on your system (e.g.,
C:\laragon\www
). - Move the cloned project folder (
rental-car-application
) into thewww
directory.
- Open Laragon.
- Start the Apache (or Nginx) and MySQL services.
- Access the Laragon database manager by clicking Menu > Database > phpMyAdmin (or your preferred tool).
- Create a new database (e.g.,
rental_car
). - Import the provided SQL schema into the database:
- Go to phpMyAdmin > Select your database > Import > Choose the SQL file > Click Go.
- Inside the project directory, create a
.env
file. - Add the following environment-specific variables to configure the database:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=rental_car
DB_USERNAME=root
DB_PASSWORD=
- Modify
DB_USERNAME
andDB_PASSWORD
if your Laragon database setup requires it.
-
Open your browser.
-
Visit
http://rental-car.test
(if you have enabled Pretty URLs in Laragon).- If Pretty URLs are not enabled, visit:
http://localhost/rental-car-application/public
- If Pretty URLs are not enabled, visit:
- Go to Menu > Quick Settings > Pretty URLs.
- Restart Laragon.
- Visit your project at
http://rental-car.test
.
- Admin: Manage vehicles, users, rentals, payments, and maintenance logs.
- Customers: Rent vehicles, make payments, and view rental history.
This project is licensed under the MIT License. See the LICENSE file for more details.
For questions or support, please contact [[email protected]].