﻿NEI-M PRINTS - DEPLOYMENT QUICK START
=====================================

1. Upload and extract this ZIP to your hosting account (cPanel subdomain folder).

2. Point the subdomain document root to the 'public' folder.
   Example: /home/username/subdomain/public

3. Create .env from .env.example in the Laravel root (NOT inside public/):

   APP_NAME="Nei-M Prints"
   APP_ENV=production
   APP_DEBUG=false
   APP_URL=https://neim-prints.vehinc.co.za

   DB_CONNECTION=mysql
   DB_HOST=localhost
   DB_PORT=3306
   DB_DATABASE=vehincs2o4c1_neim_prints
   DB_USERNAME=your_cpanel_db_user
   DB_PASSWORD=your_cpanel_db_password

   SESSION_DRIVER=database
   CACHE_STORE=database
   QUEUE_CONNECTION=database

   (Set MAIL_* and BUSINESS_EMAIL as needed.)

4. Fix permissions and reinstall vendor (required on many cPanel hosts after ZIP extract):

   cd ~/public_html/your-subdomain-folder
   chmod -R u+rwX vendor storage bootstrap/cache
   chmod -R 775 storage bootstrap/cache
   rm -rf vendor
   mkdir vendor
   chmod 775 vendor
   composer install --no-dev --optimize-autoloader

   Verify: ls -la vendor/autoload.php

5. Generate app key if APP_KEY is empty (SSH or cPanel Terminal):
   php artisan key:generate

6. Import database OR run migrations (skip migrate if DB already populated):
   - Import your SQL backup via phpMyAdmin, OR
   - php artisan migrate --force

7. Create storage link:
   php artisan storage:link

8. Clear stale cache, then cache for production:
   php artisan config:clear
   php artisan cache:clear
   php artisan config:cache
   php artisan route:cache
   php artisan view:cache

9. If you still get HTTP 500:
   - Temporarily set APP_DEBUG=true, reload the site, read the error, then set APP_DEBUG=false
   - Check storage/logs/laravel.log and cPanel Error Log
   - Confirm document root points to the public/ folder
   - Confirm PHP 8.2+ is selected in cPanel
   - Re-run the vendor reinstall commands in step 4

Included in this package:
- Compiled frontend assets (public/build)
- Production PHP dependencies (vendor)
- Database migrations and seeders
- Public images and logos

NOT included (create/configure on server):
- .env file
- Database data (import separately if needed)

See DEPLOYMENT_INSTRUCTIONS.md for full details.
