╔══════════════════════════════════════════════════════════════════╗
║           HR PORTAL — cPanel Upload Guide (No Terminal)         ║
╚══════════════════════════════════════════════════════════════════╝

DEMO LOGIN CREDENTIALS
──────────────────────
  Super Admin : admin@hrportal.my     / password
  Super Admin : johan@titiansystems.com / Tt5dd0n1y!@#
  HR (Nexus)  : hr@nexus.my           / password
  HR (Bumi)   : hr@bumiresources.my   / password


STEP 1 — UPLOAD & EXTRACT
──────────────────────────
1. Log in to cPanel → File Manager.
2. Navigate to the folder where you want the app
   (e.g. /home/youraccount/  or inside a subdomain folder).
3. Upload  hr-portal.zip  using the Upload button.
4. Select the zip → click Extract.
   You should now have a folder called  hr-portal/  containing:
     app/  bootstrap/  config/  database/  public/  vendor/  ...


STEP 2 — POINT DOCUMENT ROOT TO /public
────────────────────────────────────────
The web server must serve the  public/  subfolder, NOT the root.

Option A — Subdomain (recommended)
  cPanel → Domains → Create a New Domain (or Subdomain)
  Set "Document Root" to:
    /home/youraccount/hr-portal/public
  (adjust the path to match where you extracted the zip)

Option B — Addon Domain / Main Domain
  cPanel → Domains → Manage the domain
  Change "Document Root" to:
    /home/youraccount/hr-portal/public


STEP 3 — CONFIGURE .env
────────────────────────
1. Inside the hr-portal/ folder, rename  .env.production  →  .env
   (or open .env.production, copy all its contents into a new file
    named  .env  in the same folder).
2. Open  .env  in the File Manager editor.
3. Change this one line to your actual domain:
     APP_URL=https://yourdomain.com
4. Save the file.


STEP 4 — SET FOLDER PERMISSIONS
─────────────────────────────────
In File Manager, right-click each folder below → Change Permissions:

  hr-portal/storage/              → 755  (and all contents)
  hr-portal/bootstrap/cache/     → 755

If you see a "Permission denied" error on the site, also set:
  hr-portal/database/database.sqlite  → 644


STEP 5 — VISIT YOUR SITE
─────────────────────────
Open your domain in a browser.
The database is already seeded — no migration needed.
Log in with the credentials at the top of this file.


TROUBLESHOOTING
───────────────
• Blank page / 500 error
    → Temporarily set  APP_DEBUG=true  in  .env,  reload to see
      the error message, then set it back to  false.

• "No application encryption key"
    → Make sure  .env  exists (not just  .env.production)  and
      the APP_KEY line is present.

• "Unable to write to database"
    → Set  database/database.sqlite  permissions to  664  and
      the  database/  folder to  755.

• CSS / JS not loading (404)
    → Confirm your document root points to  hr-portal/public/
      not to  hr-portal/  itself.

• Redirect loop on login
    → Add this line to  .env:
        SANCTUM_STATEFUL_DOMAINS=yourdomain.com

• PHP version
    → This app requires PHP 8.2 or higher.
      In cPanel → MultiPHP Manager, switch the folder to PHP 8.2+.
