| Task | Description | Status |
|---|---|---|
| Environment Variables | Set APP_ENV=production, APP_DEBUG=false | ☐ |
| Database Migrations | All migrations tested and working | ☐ |
| Seeders | Production seeders ready (if needed) | ☐ |
| Testing | All tests passing | ☐ |
| Documentation | README and user manual complete | ☐ |
| Git Repository | All code committed and pushed | ☐ |
| Dependencies | composer.lock and package-lock.json updated | ☐ |
| Assets | CSS/JS compiled for production | ☐ |
| Security | All security best practices implemented | ☐ |
# Application
APP_NAME="Library Management System"
APP_ENV=production
APP_DEBUG=false
APP_URL=https://yourdomain.com
# Database
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=your_database_name
DB_USERNAME=your_database_user
DB_PASSWORD=your_secure_password
# Mail (Update with production SMTP)
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your-email@gmail.com
MAIL_PASSWORD=your-app-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=your-email@gmail.com
MAIL_FROM_NAME="${APP_NAME}"
# Session & Cache (Use database in production)
SESSION_DRIVER=database
CACHE_DRIVER=database
# Queue (Use database for simplicity)
QUEUE_CONNECTION=database
# Clear all caches
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear
# Optimize for production
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan optimize
# Compile assets
npm run build
# Exclude unnecessary files
# Create .deployignore or use Git archive
# Using Git (recommended)
git archive --format=zip --output=library-system.zip main
# Or manually zip (excluding node_modules, .git, etc.)
# Exclude: node_modules, .git, .env, storage/logs/*
public_html directorylibrary-system) or use root# Set permissions via cPanel File Manager:
# Right-click → Change Permissions
storage/ - 755
storage/framework/ - 755
storage/framework/cache/ - 755
storage/framework/sessions/ - 755
storage/framework/views/ - 755
storage/logs/ - 755
bootstrap/cache/ - 755
username_library).env file# Access Terminal in cPanel or use SSH
# Navigate to project directory
cd public_html/library-system
# Install dependencies (if not included)
composer install --optimize-autoloader --no-dev
# Generate application key
php artisan key:generate
# Run migrations
php artisan migrate --force
# Create storage link
php artisan storage:link
# Cache configurations
php artisan config:cache
php artisan route:cache
php artisan view:cache
Point your domain to the public folder:
public_html/library-system/publichttps://yourdomain.comCreate/edit .htaccess in public folder:
<IfModule mod_rewrite.c>
RewriteEngine On
# Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
# Laravel rewrite rules
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
| Test | Expected Result | Status |
|---|---|---|
| Homepage loads | No errors, CSS/JS working | ☐ |
| Registration works | Can create new account | ☐ |
| Login works | Can authenticate successfully | ☐ |
| Database connection | Data displays correctly | ☐ |
| File uploads | Images upload and display | ☐ |
| Email sending | Notifications received | ☐ |
| CRUD operations | Create/Read/Update/Delete work | ☐ |
| HTTPS enabled | Secure connection (padlock icon) | ☐ |
| Mobile responsive | Works on mobile devices | ☐ |
# Solutions:
1. Check .env file exists and has correct values
2. Check file permissions (storage and bootstrap/cache)
3. Run: php artisan config:clear
4. Check error logs: storage/logs/laravel.log
5. Enable error display temporarily in .env:
APP_DEBUG=true (remember to set to false after fixing!)
# Solutions:
1. Verify database credentials in .env
2. Check database exists in cPanel
3. Verify database user has privileges
4. Check DB_HOST (usually 'localhost' in shared hosting)
5. Test connection via cPanel → phpMyAdmin
# Solutions:
1. Check APP_URL in .env matches your domain
2. Run: php artisan storage:link
3. Verify public folder is document root
4. Check .htaccess file exists in public folder
5. Clear browser cache
# Solutions:
1. Run: php artisan storage:link
2. Check storage/app/public folder permissions (755)
3. Verify upload_max_filesize in PHP settings
4. Check post_max_size in PHP settings
5. Verify storage disk configuration in config/filesystems.php
# Solutions:
1. Verify SMTP credentials in .env
2. Check MAIL_FROM_ADDRESS is valid
3. Enable "Less secure apps" for Gmail (or use App Password)
4. Test with: php artisan tinker
>>> Mail::raw('Test', function($msg) {
$msg->to('test@example.com')->subject('Test');
});
5. Check spam folder
storage/logs/laravel.log# Database Backup (via cPanel or command)
mysqldump -u username -p database_name > backup.sql
# File Backup
# Use cPanel Backup Wizard or FTP to download files regularly
# Automated Backups
# Configure cPanel automated backups if available
Your application is now live and accessible to users worldwide!
Share your project: