Skip to content

amarhumayunx/appointment-booking

Repository files navigation

Appointment Booking System

Laravel online appointment booking: schedule, update, and cancel with email notifications.

An appointment booking system built with PHP 8+, Laravel 11, Blade, and MySQL/SQLite. Users can book, reschedule, and cancel appointments. The app manages availability (hourly slots), prevents double-booking, and sends confirmation/cancellation emails.


About the project

This project implements an online appointment booking system that:

  • Lets users book appointments (guest name, email, phone, date, time, notes) with validation.
  • Manages availability with hourly slots (9:00–17:00) and prevents overlapping bookings.
  • Supports updates – reschedule or change guest details and status (confirmed, cancelled, completed, no_show).
  • Handles cancellation from the management panel and sends a cancellation email.
  • Sends notifications – confirmation on book, update notice on change, cancellation notice on cancel.

It meets requirements for booking form, calendar view, management panel, and confirmation notifications. Default database is SQLite so you can run it without MySQL.


Tech stack

Requirement Used
PHP 8.2+
Framework Laravel 11
Database MySQL or SQLite
Date & time Carbon
Views Blade
Validation Laravel validation
Notifications Laravel Mail (log/SMTP)
Git Yes

Features

  • Appointment scheduling – Form with guest name, email, phone, date, start time, notes.
  • Availability management – Hourly slots 9–17; overlap check on book/update; JSON endpoint for available slots.
  • Booking updates – Edit appointment (guest, date, time, status, notes); validation and conflict check.
  • Cancellation – Cancel from manage panel or set status to cancelled; cancellation email sent.

Screens

  • Booking form/appointments/book – Full form with validation.
  • Calendar view/appointments/calendar – Month navigation and list of appointments.
  • Management panel/appointments/manage – List, filter by status/date, view, edit, cancel.
  • Appointment detail – View single appointment and link to edit.
  • Confirmation notifications – Email on create, update, and cancel (via Laravel Mail).

Setup

1. Clone and install

git clone <your-repo-url> appointment-booking
cd appointment-booking
composer install

2. Environment

cp .env.example .env
php artisan key:generate

3. Database

Option A – SQLite (default, no MySQL needed)

.env already has DB_CONNECTION=sqlite. Run:

php artisan migrate

Option B – MySQL

Create a database (e.g. task2_appointments), set in .env:

DB_CONNECTION=mysql
DB_DATABASE=task2_appointments
DB_USERNAME=root
DB_PASSWORD=your_password

Then:

php artisan migrate

4. Run

php artisan serve

Open http://localhost:8000/appointments/calendar


Routes

Method URI Description
GET /appointments/calendar Calendar view (query: month)
GET /appointments/book Booking form
POST /appointments/book Create appointment (sends confirmation email)
GET /appointments/manage Management panel (filter by status, date)
GET /appointments/availability/slots JSON available slots (query: date)
GET /appointments/{id} Appointment details
GET /appointments/{id}/edit Edit form
PUT /appointments/{id} Update (sends email if updated/cancelled)
DELETE /appointments/{id} Cancel (sends cancellation email)

Notifications

  • Created – Confirmation email with date/time.
  • Updated – Email with updated date/time.
  • Cancelled – Email confirming cancellation.

With MAIL_MAILER=log (default), emails are written to storage/logs/laravel.log. Set SMTP in .env for real email delivery.


License

MIT