๐ Project Documentation
๐งฑ Environment
Laravel (modular, service-based)
๐ฏ Purpose
ูAppointment Treatment Reservation Booking System
๐ฅ User Roles
- Admin
- Provider
- User
- Development
๐๏ธ Database & Permissions
Role-based access control via Spatie package. Providers extend users.
๐ API Conventions
Request validation, Resource formatting, Route structure: /api/{role}/{resource}/{action}
๐งฑ Example Modules Structure
This Laravel project uses nwidart/laravel-modules
to support a clean and scalable modular
architecture. Each module contains the following folders:
Config/
โ Configuration filesConsole/
โ Custom Artisan commandsDatabase/
โ Migrations, Seeders, FactoriesEntities/
โ Eloquent models (e.g. User.php)Http/
โ Controllers, Middleware, Requests (grouped by roles)Providers/
โ Service providers to bind services/routesResources/
โ Blade templates (optional, not used in API-based modules)Routes/
โ API/web route filesServices/
โ Business logic with interface and implementationTests/
โ Unit/feature testsTransformers/
โ Laravel API Resources grouped by role
๐ฑ Seeder Strategy
Seeders help create consistent dummy data across dev environments and automate testing. Each module may contain:
UsersTableSeeder
โ Generates admins, providers, users with random or fixed attributesRolesSeeder
โ Syncs role/permission structures (via Spatie or Laratrust)ProviderSeeder
โ Populates providers with linked services, specializationsCalendarSeeders
โ Fills years, months, weekdays, and daysReservationSeeder
โ Optionally generates sample booking data
๐ค AI RULES for Modification
This project is intended to be AI-agent friendly (e.g., Cursor, GPT-based agents). Follow these rules to ensure maintainability and smooth collaboration with agents:
- โ Avoid putting business logic in controllers.
- โ Always inject interfaces (Service Pattern).
- ๐ฆ Validate inputs using Form Request classes.
- ๐ค Format responses via Laravel Resources (Transformers).
- ๐งช Seeders should cover core test data (roles, users, relations).
- ๐ง Follow naming conventions and keep modules self-contained.
- ๐ Store all dynamic files in their module (Routes, Configs, Services...)
๐งฎ Database Structure & Relationships

Mermaid ER Diagram and table summaries of all key entities.
๐งฐ Composer Packages & Usage
This project utilizes a carefully curated set of Composer packages. Highlights include:
nwidart/laravel-modules
: Enables true modular structurespatie/laravel-permission
: Role and permission managementspatie/laravel-medialibrary
: Handles file uploads and associationscviebrock/eloquent-sluggable
: Auto-generate SEO-friendly slugsshetabit/payment
: Powerful multi-gateway payment layerlaravel/passport
&sanctum
: Advanced API authenticationvinkla/hashids
: Obfuscates IDs for user-friendly URLsdedoc/scramble
&scribe
: Live API docs from code
All packages are well-integrated and follow PSR and Laravel service provider conventions. No unnecessary dependencies are installed.