This shell script automates the setup and checks necessary after deploying a Laravel application. It ensures all critical components, such as directories, permissions, and services, are correctly configured for smooth operation. 🛠️
- ✅ Checks: Validates the existence of essential storage folders and subfolders.
- 🔐 Sets Permissions: Ensures correct permissions on storage and bootstrap/cache directories.
- 🧹 Caches Management: Clears and re-caches configurations, routes, and views.
- 🔗 Database Verification: Confirms the database connection by checking migration status.
- 📂 Environment Setup: Confirms
.env
file and necessary variables are correctly set. - 🔄 Storage Symlink: Ensures symlink creation for the storage directory.
- 🔍 File Verification: Checks for
.htaccess
in the public directory. - 📦 Dependency Management: Installs or updates Composer dependencies.
- ⏳ Migration Check: Looks for pending database migrations.
- 🔑 Key Generation: Creates a new application key.
- 🧪 Queue Testing: Dispatches a test job to ensure the queue is working.
- 📋 Summary Report: Provides a final summary of all checks performed.
- Ensure the script is executed at the root directory of your Laravel project.
- Your Laravel setup should have a configured queue connection.
- Download/Copy the script into your project's root directory.
- Make executable:
chmod +x run.sh
- Execute:
./run.sh
Directly download and execute the script with:
wget -O - https://raw.githubusercontent.com/elabda3company/ShLaravel/main/run.sh | bash
- Storage Check: Ensures
storage
and subdirectories exist. - Permissions: Sets correct permissions on necessary directories.
- Caching: Clears and re-caches settings for optimal performance.
- Database Connection: Verifies connection through migration status.
- Environment Checks: Validates
.env
setup. - Symlink Creation: Verifies or creates storage symlink.
- File Presence: Confirms
.htaccess
existence for Apache configurations. - Dependencies: Manages Composer dependencies.
- Migrations: Checks for and alerts on pending migrations.
- Key Generation: Generates a new application key.
- Queue Test: Tests queue functionality with a job dispatch.
- Summary: Provides a comprehensive check summary.
George Awad
Digital Creativity Co
https://el-abda3.com
Licensed under the MIT License. See the LICENSE file for more details.