A modern parking reservation system built with Laravel. Users can book parking slots, track time in real-time, and pay on exit.
- โ User registration and authentication
- โ Browse 100 parking slots organized by floors (Ground Floor to 4th Floor)
- โ Real-time slot availability
- โ Book parking slots instantly
- โ Real-time timer and cost calculator
- โ Pay-on-exit system
- โ View booking history
- โ Beautiful responsive UI with purple gradient theme
- ๐ง Admin dashboard
- ๐ง Manage parking slots
- ๐ง View all reservations
- ๐ง Generate reports
Before you begin, make sure you have installed:
- PHP 8.1 or higher
- Composer
- SQLite (comes with PHP)
- Node.js & NPM (optional, for asset compilation)
git clone <your-repo-url>
cd parksmartcomposer installCopy the example environment file:
cp .env.example .envGenerate application key:
php artisan key:generateThe project uses SQLite. The database file should already exist at database/database.sqlite.
If it doesn't exist, create it:
touch database/database.sqliteRun migrations:
php artisan migrateOpen Laravel Tinker:
php artisan tinkerCreate 100 parking slots (5 floors, 20 slots each):
$floors = [
['name' => 'Ground Floor', 'prefix' => 'GF', 'price' => 200],
['name' => '1st Floor', 'prefix' => '1F', 'price' => 150],
['name' => '2nd Floor', 'prefix' => '2F', 'price' => 120],
['name' => '3rd Floor', 'prefix' => '3F', 'price' => 100],
['name' => '4th Floor', 'prefix' => '4F', 'price' => 80],
];
foreach ($floors as $floor) {
for ($i = 1; $i <= 20; $i++) {
\App\Models\ParkingSlot::create([
'slotNumber' => $floor['prefix'] . '-' . str_pad($i, 2, '0', STR_PAD_LEFT),
'location' => $floor['name'],
'status' => 'Available',
'pricePerHour' => $floor['price']
]);
}
}
echo "Created 100 parking slots!";Verify slots were created:
\App\Models\ParkingSlot::count(); // Should return 100Type exit to leave Tinker.
Open Tinker again:
php artisan tinkerCreate an admin user:
\DB::table('User')->insert([
'fullName' => 'Admin User',
'email' => 'admin@parksmart.com',
'password' => bcrypt('admin123'),
'phoneNumber' => '0712345678',
'role' => 'admin',
'dateRegistered' => now()
]);Verify admin was created:
\DB::table('User')->where('email', 'admin@parksmart.com')->first();Type exit to leave Tinker.
php artisan serveThe application will be available at: http://127.0.0.1:8000
- Visit the landing page:
http://127.0.0.1:8000 - Register: Click "Get Started (Register)"
- Login: Use your credentials
- View Slots: Click "View Slots" from the dashboard
- Book a Slot: Choose a slot and click "Book Now"
- Track Your Booking: Go to "My Reservations" to see real-time timer and cost
- End & Pay: Click "End Reservation & Pay" when done parking
- Admin Login:
http://127.0.0.1:8000/admin/login - Credentials:
- Email:
admin@parksmart.com - Password:
admin123
- Email:
- Admin Dashboard: (To be implemented by team member)
parksmart/
โโโ app/
โ โโโ Http/Controllers/
โ โ โโโ Admin/ # Admin controllers
โ โ โโโ User/ # User controllers
โ โโโ Models/ # Eloquent models
โโโ database/
โ โโโ migrations/ # Database migrations
โ โโโ database.sqlite # SQLite database file
โโโ resources/
โ โโโ views/
โ โโโ admin/ # Admin views
โ โโโ auth/ # Authentication views
โ โโโ user/ # User views
โโโ routes/
โ โโโ web.php # Web routes
โโโ public/ # Public assets
- User - User accounts (both regular users and admins)
- parking_slots - Parking slot information
- Reservation - User bookings and reservations
- Payment - Payment records
- Vehicle - User vehicle information
/- Landing page/login- User login/register- User registration
/dashboard- User dashboard/slots- View available parking slots/my-reservations- View user's bookings/slots/{id}/book- Book a specific slot
/admin/login- Admin login/admin/dashboard- Admin dashboard (to be implemented)
- Modern purple gradient theme
- Responsive design (mobile-friendly)
- Real-time timer (updates every second)
- Real-time cost calculator
- Smooth animations and transitions
- Organized by floor tabs
- Color-coded status badges
Solution: Run the Tinker command to create slots (Step 5)
Solution: Make sure you created the admin account with role = 'admin' (Step 6)
Solution: Clear cache with php artisan cache:clear and try again
Solution:
php artisan migrate:freshThen re-run Steps 5 & 6 to recreate slots and admin
-
Member 1: User-side functionality (Completed โ )
- Authentication
- Booking system
- Real-time timer & payment
- UI/UX design
-
Member 2: Admin dashboard (Pending ๐ง)
- Slot management
- User management
- Reservation overview
- Reports & analytics
-
Database: The project uses SQLite. The
database.sqlitefile is NOT pushed to GitHub. Each team member needs to run migrations and seeders. -
Environment: The
.envfile is NOT in GitHub. Copy from.env.exampleand configure. -
Admin Password: Change the default admin password in production!
-
Payment: Currently simulated (no real payment gateway). Click "Complete Payment" to mark as paid.
-
Foreign Keys: Some foreign key constraints were removed for flexibility during development.
- View all parking slots with status
- Add/Edit/Delete parking slots
- View all active reservations
- View completed reservations with payment status
- View all registered users
- Generate revenue reports
- Dashboard with statistics (total revenue, occupancy rate, etc.)
- Search and filter functionality
- Modern admin theme (match user-side purple theme)
- Responsive tables
- Charts/graphs for analytics
- Quick stats cards
-
Models already exist: Check
app/Models/for ParkingSlot, Reservation, User, etc. -
Use existing controllers:
app/Http/Controllers/Admin/has some scaffolding -
Routes are set up: Check
routes/web.phpfor admin routes -
Database structure:
parking_slotstable (primary key:id)Reservationtable (primary key:reservationID)Usertable (primary key:userID)
-
Key relationships:
- Reservation belongs to User
- Reservation belongs to ParkingSlot
- User has many Reservations
If you encounter issues:
- Check the Troubleshooting section
- Clear cache:
php artisan cache:clear - Check Laravel logs:
storage/logs/laravel.log - Contact team members
This project is for educational purposes (Group Project).
Happy Coding! ๐