# DEPLOY INSTINCT EDUCATION — Laravel / cPanel

## Requirement
- PHP 8.2+ (recommended PHP 8.3)
- MySQL 8 / MariaDB compatible
- Extensions: PDO MySQL, mbstring, openssl, tokenizer, xml, ctype, json, fileinfo
- `zip` extension is required only for XLSX export.
- Laravel Composer dependencies in `vendor/`.

## Important Laravel document root
Do not point the domain to the Laravel project root.

Example:
- Project: `/home/USER/instinct/`
- Domain Document Root: `/home/USER/instinct/public`

The `.env`, `app/`, `database/`, `vendor/`, and `storage/` directories must remain outside the web document root.

## cPanel deployment without terminal
Laravel itself still requires Composer's `vendor/` directory.

Use one of these methods:
1. cPanel PHP Composer / Composer Manager, if provided by the hosting company:
   - Application root: `/home/USER/instinct`
   - Run Install from `composer.json`
2. Or run `composer install --no-dev --optimize-autoloader` on a local PHP 8.3 computer, then upload the resulting `vendor/` directory together with this project.

There is no safe Laravel deployment that can omit `vendor/`.

## Database without Artisan
This package contains:
`database/install.sql`

Create the MySQL database and MySQL user in cPanel, grant ALL PRIVILEGES, then import `database/install.sql` using phpMyAdmin.

You therefore do not need to run `php artisan migrate` for the initial cPanel installation.

## Environment
Copy `.env.example` to `.env`, then set at least:

```env
APP_URL=https://your-domain.example
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=cpanel_database_name
DB_USERNAME=cpanel_database_user
DB_PASSWORD=your_database_password
```

A deployment APP_KEY has already been generated in `.env.example`:
`base64:ctB117tRyNCMYzCb2Zjnmm9n3SitFkWfwdgJQrlbW0M=`

For a different installation, generating a new APP_KEY is recommended.

## Permissions
Make sure these directories are writable by PHP:
- `storage/`
- `bootstrap/cache/`
- `public/uploads/questions/`

Typical shared-hosting permission is 755 or 775 depending on the hosting configuration.

## Initial administrator
Email: `admin@instinct.education`
Password: `Instinct@2026!`

Change the administrator password after first login.
