# HotelPlus — Single-Hotel Management System

Centralized hotel operations platform for **one hotel**: reservations, front desk, housekeeping, billing, inventory, maintenance, HR scaffolding, reports, and a public booking engine.

Inspired by the Appealing-theme (RestroPro) green admin UI — adapted to Laravel Blade + Bootstrap 5.

## Stack

- Laravel 11 / PHP 8.2+
- MySQL 8+
- Blade + Bootstrap 5
- Spatie Laravel Permission
- DomPDF (invoices)

## Exclusions (by design)

No multi-hotel/branches, restaurant/POS/kitchen/F&B, conference/banquet/events/venues, or CRM/leads/pipelines.

## Quick start (XAMPP)

1. Ensure Apache + MySQL are running.
2. Point the vhost or open: `http://localhost/hotelplus/reservation/public`
3. Database `hotelplus` is already created if you used the local setup below.

### Fresh install via wizard

1. Delete `storage/installed` if present.
2. Visit `/install` and complete requirements → hotel → database → admin.
3. Login and open the dashboard.

### Local demo credentials (seeded)

- **Email:** `admin@hotelplus.test`
- **Password:** `password`
- **Roles:** 16 recommended roles with module permissions

### CLI setup

```bash
# From project root (use XAMPP PHP)
C:\xampp\php\php.exe ..\composer.phar install
C:\xampp\php\php.exe artisan key:generate
# Configure .env DB_* for MySQL
C:\xampp\php\php.exe artisan migrate --seed
echo installed > storage\installed
C:\xampp\php\php.exe artisan storage:link
```

## Main modules delivered

| Area | Features |
|------|----------|
| Auth & RBAC | Login, Spatie roles/permissions, custom roles |
| Hotel settings | Single hotel profile (no branch selector) |
| Dashboard | Occupancy KPIs, revenue, arrivals/departures, alerts |
| Rooms | Types, amenities, rooms, status blocking |
| Reservations | Create/cancel, availability engine, double-booking prevention |
| Calendar | Room timeline view |
| Front desk | Check-in / check-out with folio + HK task |
| Folios & payments | Charges, payments, reversals |
| Rates & packages | Rate plans, accommodation packages, promo codes (pricing service) |
| Housekeeping | Task board & status updates |
| Maintenance | Work orders with optional room blocking |
| Inventory | Products, stock movements |
| Corporate / agents | Account CRUD |
| Night audit | Daily room charge posting, no-shows, business date roll |
| Reports | Occupancy, revenue, arrivals, etc. |
| Public booking | `/book` search → rooms → book → confirmation |
| Installer | Requirements, DB, migrate, admin, lock file |
| Audit | AuditService logging for sensitive actions |

## URLs

| URL | Purpose |
|-----|---------|
| `/login` | Staff login |
| `/admin` | Dashboard |
| `/book` | Public booking engine |
| `/install` | Installation wizard (locked after install) |

## cPanel / shared hosting

1. Upload project **above** `public_html` when possible; point document root to `public/`.
2. Or place the whole app in a subdirectory and use `public/` as the web root (or copy `public/.htaccess` carefully).
3. Set PHP 8.2+, enable `pdo_mysql`, `mbstring`, `openssl`, `tokenizer`, `xml`, `ctype`, `json`, `fileinfo`, `curl`.
4. Make writable: `storage/`, `bootstrap/cache/`.
5. Cron: `* * * * * php /path/to/artisan schedule:run`
6. Queue: database driver is configured; run `php artisan queue:work` or use cron worker.

## Security notes

- Passwords hashed (bcrypt)
- CSRF on forms
- Role/permission ready (apply middleware per route as needed)
- Sensitive docs intended for `storage/app/private`
- Never hard-code payment/SMS credentials — use `.env`

## Development notes

- Availability: `App\Services\AvailabilityService`
- Pricing priority: negotiated → promo → seasonal → weekend → standard (`PricingService`)
- Folios: `FolioService`
- Check-in/out: `FrontDeskService`
- Night audit: `NightAuditService`

## Testing

```bash
C:\xampp\php\php.exe artisan test
```

Feature tests cover auth and availability conflict prevention (see `tests/Feature`).

## Roadmap / remaining depth

Core operational paths are implemented. Further hardening can extend: full procurement workflow UI, payroll/attendance UI, laundry/transport/spa screens, channel manager adapters, M-Pesa/Pesapal gateways, biometric hooks, and expanded PDF templates — schema and navigation hooks are prepared where applicable.
