# FleetModus — installation, licence and updates

Each installation is one **Customer**, licensed by **GlobalHub**. Inside it the customer creates one or more **companies**, each managing its own fleet. The limits (companies, vehicles, drivers, users) and the modules come from the signed licence and are shared by the whole installation.

**Requirements:** PHP 8.3 or later (tested for 8.5) with `pdo_mysql`, `mbstring`, `openssl`, `fileinfo`, `zip`, `gd`, `dom`, `xml`, `tokenizer`, `ctype` and `json`. You also need MySQL 8 or MariaDB 10.6+ and HTTPS. No Composer, Node or terminal is required.

## 1. Install (install.php)
1. In cPanel → **MySQL® Databases**, create an empty database and a user with all privileges.
2. Upload `fleetmodus_vX.Y.Z.zip` and extract it **outside** `public_html` (e.g. `/home/user/fleetmodus`).
3. Point the domain or subdomain to `fleetmodus/public`. If the Document Root cannot be changed, extract into the domain folder and rename `.htaccess.raiz` to `.htaccess`.
4. Open the address in a browser. The **installation wizard** (English or Portuguese) checks the requirements, asks for the database, URL, language, your super administrator account, the first company and outgoing email, and creates the `.env` (with `APP_KEY` and the GlobalHub **installation key**), the tables and your account.
5. At the end, click **Delete install.php now** (the installer refuses to run again anyway).
6. **Cron** (every 5 minutes): `php /home/user/fleetmodus/artisan schedule:run >> /dev/null 2>&1`
7. **Keep a copy of `.env`.**

## 2. Licence (GlobalHub)
Give the installation key and domain shown by the wizard when requesting the licence or trial. Then go to **Licence**, paste the key from the email or upload the `.lic` file. The licence is validated offline on every request and confirmed online once a day.

Without a GlobalHub connection the platform keeps working; after 14 days without confirmation it shows a warning but never blocks for lack of network.

The platform becomes **read-only** (no data is ever deleted) when the licence:
- has expired and the grace period has passed;
- is blocked or replaced;
- belongs to another installation or domain;

Renewals, upgrades and server/domain changes are requested on the same page.

## 3. Updates
Go to **Updates**:
- **Via GlobalHub:** download and install. The SHA-256, the signature and the updates entitlement are verified before installing.
- **Manual:** upload `fleetmodus_vX.Y.Z.zip`, or put it in `storage/app/updates/incoming/` via FTP and pick it from the list.

The replacement is complete: application folders are swapped as a whole. It never replaces `.env`, `storage/`, `bootstrap/cache`, the root `.htaccess` or the hosting PHP settings. Files and the database are backed up first; migrations run automatically and, if they fail, everything is restored. New versions show a notice with Update now / Later / Skip (security updates cannot be hidden).
