# Automode Laravel 12 / PHP 8.4 integration starter

## What this actually delivers
- Supplied EcomDrive schema (150 tables), generated Eloquent models and seeder, unchanged from source.
- Supplied Bootstrap design pages and static assets, with authenticated **read-only preview** routes.
- A small MVC controller and two test cases. No claim that demo UI is wired to database.

## Important limitations
This is an **overlay for a fresh Laravel application**, not a complete Laravel installation. The execution environment has PHP 8.4 but no Composer, so vendor dependencies and framework skeleton cannot be packaged or tested here. Authentication and multi-business authorization have **not** been implemented. The preview is deliberately auth-protected and is not tenant-scoped; do not publish it for customer use. Generated EcomDrive User is not an Authenticatable class, so do not replace Laravel's default auth model without a full auth integration.

## Setup on a PHP 8.4 + Composer + MySQL 8 server
1. `composer create-project laravel/laravel automode "^12.0"`
2. `cd automode`
3. Copy the contents of this package into the Laravel project, preserving directories. Do not overwrite a customized production application.
4. Add `require __DIR__.'/automode.php';` to the **end** of `routes/web.php` (the imported route itself has web/auth middleware).
5. Configure `.env` for a **new empty MySQL 8 database**, then `php artisan key:generate`.
6. **STOP before migrating**: the provided schema creates a `users` table and Laravel's default migration also creates `users`. Reconcile Laravel default migrations and the provided `users` table; do not run both unmodified. Likewise check default jobs/cache tables and all constraints.
7. After schema reconciliation, run `php artisan migrate` and `php artisan db:seed --class=EcomDriveSeeder`.
8. Install and configure a compatible authentication implementation and reconcile its User model/schema before using `/automode/preview`.
9. Run `php artisan test` and test authorization, tenancy, and all financial/inventory workflows before production deployment.

## Security caveat
The original design's JS may include demo-only behaviors and links; preview is **not** business functionality. Route auth protects preview HTML, but public static assets are public by design. Review JavaScript and remove fake actions before production. Generated models use `$guarded = ['id']` and require hardening. The SQL migration uses non-atomic DDL. Cross-tenant foreign-key integrity is incomplete. See source README.

## Known risk
The provided `DesignPreviewTest` is a starter test and has not been executed. If your auth stack redirects to a missing `login` route, install auth before exercising it.
