PHPackages                             ez-it-solutions/laravel-init - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ez-it-solutions/laravel-init

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ez-it-solutions/laravel-init
============================

A comprehensive Laravel Initialization Utility that combines several functions and features specific to Laravel projects

v1.0.2(8mo ago)01MITPHPPHP ^7.3|^8.0

Since Sep 8Pushed 8mo agoCompare

[ Source](https://github.com/ez-it-solutions/laravel-init)[ Packagist](https://packagist.org/packages/ez-it-solutions/laravel-init)[ RSS](/packages/ez-it-solutions-laravel-init/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Laravel Initialization Utility
==============================

[](#laravel-initialization-utility)

[![Ez IT Solutions](https://github.com/ez-it-solutions.png)](https://github.com/ez-it-solutions.png)### A comprehensive Laravel Initialization Utility

[](#a-comprehensive-laravel-initialization-utility)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![PHP Version](https://camo.githubusercontent.com/972b840d9163498d88f90dbadd724a8de7bd81f38b94703db3faae0448d61c4d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e332532422d626c75652e737667)](https://www.php.net/)[![Laravel Version](https://camo.githubusercontent.com/86058611080fc7c33f16c10a4019d3513213c4ba0b77b2d11d7704ba5b7d926d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d362e302532422d7265642e737667)](https://laravel.com/)[![Packagist Version](https://camo.githubusercontent.com/3f98fa0a785b4c93a40b88678594794b94019a39c9d404b3834d58de6deff79c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5061636b61676973742d76312e302e302d6f72616e67652e737667)](https://packagist.org/packages/ez-it-solutions/laravel-init)

A powerful toolkit that combines several functions and features specific to Laravel projects, including application initialization, deployment, optimization, database management, and more.

📋 Overview
----------

[](#-overview)

The Laravel Initialization Utility is a comprehensive toolkit designed to streamline the entire lifecycle of Laravel application development, deployment, and maintenance. It provides a collection of powerful commands that handle everything from initial setup to production optimization.

[![Command Output Example](https://camo.githubusercontent.com/1824bff77529e2a44051942cae302fef0bfbb606c19737fb84165da93fcb735b/68747470733a2f2f7669612e706c616365686f6c6465722e636f6d2f363030783330303f746578743d4c61726176656c2b496e697469616c697a6174696f6e2b5574696c697479)](https://camo.githubusercontent.com/1824bff77529e2a44051942cae302fef0bfbb606c19737fb84165da93fcb735b/68747470733a2f2f7669612e706c616365686f6c6465722e636f6d2f363030783330303f746578743d4c61726176656c2b496e697469616c697a6174696f6e2b5574696c697479)

This utility combines multiple essential functions into a single, cohesive package, eliminating the need for various separate tools and scripts. Whether you're setting up a new project, preparing for deployment, or optimizing performance, this toolkit has you covered.

🛠️ Custom Commands
------------------

[](#️-custom-commands)

[![Command Reference](https://camo.githubusercontent.com/fd8140797cdef538e87965be6ead8aa181d003ab77213a816ee6ed4efc435474/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6d6d616e642d5265666572656e63652d626c75652e737667)](#custom-commands)

### 🧙‍♂️ Interactive Setup Wizard

[](#‍️-interactive-setup-wizard)

```
# Start the interactive CLI setup wizard
php artisan app:setup

# Options:
#   --non-interactive  Run in non-interactive mode with default options
#   --skip-intro      Skip the introduction screen

# Start the web-based setup wizard
php artisan app:setup --web

# Or directly launch the web wizard
php artisan app:web-setup

# Web wizard options:
#   --port=8000       The port to use for the web server
#   --host=127.0.0.1  The host to use for the web server
#   --no-open         Do not open the browser automatically
```

The setup wizard provides a user-friendly interface for configuring and using various features of the Laravel Initialization Utility, including:

- Viewing README and help documentation
- Checking application status
- Configuring application settings
- Setting up database connections
- Installing frontend assets
- Optimizing the application
- Creating database backups
- Building configuration files

[![CLI Setup Wizard Screenshot](https://camo.githubusercontent.com/64e9cf47a10335167772152337e668e2afbce81b98f634388afc3c2035377873/68747470733a2f2f7669612e706c616365686f6c6465722e636f6d2f383030783435303f746578743d434c492b53657475702b57697a6172642b53637265656e73686f74)](https://camo.githubusercontent.com/64e9cf47a10335167772152337e668e2afbce81b98f634388afc3c2035377873/68747470733a2f2f7669612e706c616365686f6c6465722e636f6d2f383030783435303f746578743d434c492b53657475702b57697a6172642b53637265656e73686f74)*Interactive CLI setup wizard with easy-to-use menus*

#### Web-Based Setup Wizard

[](#web-based-setup-wizard)

The web-based setup wizard provides a modern, responsive interface for configuring your Laravel application through your browser. It offers all the same functionality as the CLI wizard but with a more visual and intuitive interface.

[![Web Setup Wizard Screenshot](https://camo.githubusercontent.com/246cc3aea2afb619d6ea466e0900475b6c45c330777e82eb24495380dd3dd739/68747470733a2f2f7669612e706c616365686f6c6465722e636f6d2f383030783435303f746578743d5765622b53657475702b57697a6172642b53637265656e73686f74)](https://camo.githubusercontent.com/246cc3aea2afb619d6ea466e0900475b6c45c330777e82eb24495380dd3dd739/68747470733a2f2f7669612e706c616365686f6c6465722e636f6d2f383030783435303f746578743d5765622b53657475702b57697a6172642b53637265656e73686f74)*Web-based setup wizard with a modern, responsive design*

Features of the web-based wizard:

- **Dashboard**: Overview of all available features
- **Documentation Viewer**: View README and help documentation directly in the browser
- **Status Checker**: Check the status of your application's configuration and packages
- **Configuration Forms**: Easy-to-use forms for configuring your application
- **Step-by-Step Process**: Guided setup process with progress indicators
- **Responsive Design**: Works on all devices, from desktop to mobile

### 📊 Application Status

[](#-application-status)

```
# Check the status of Laravel Init packages and configurations
php artisan app:status

# Options:
#   --verbose         Display detailed information
#   --config-only     Only check configuration files
#   --packages-only   Only check installed packages
```

The status command provides a comprehensive report of your Laravel application's initialization status, including:

- Configuration files
- Environment variables
- Installed Node packages
- Installed Composer packages
- System information

### 💾 Database Backup

[](#-database-backup)

```
# Create and manage database backups
php artisan db:backup

# Options:
#   --tables=         Comma-separated list of tables to backup (default: all tables)
#   --exclude=        Comma-separated list of tables to exclude from backup
#   --filename=       Custom filename for the backup
#   --format=sql      Output format (sql, gz, zip)
#   --storage=        Storage disk to use (local, s3, etc.)
#   --path=           Custom path within the storage disk
#   --no-compress     Do not compress the backup file
#   --with-data       Include data in the backup (default)
#   --structure-only  Only backup the database structure, not the data
#   --notify          Send notification when backup is complete
#   --force           Force the operation to run when in production
```

The database backup command provides powerful features for creating and managing database backups, including:

- Selective table backup
- Multiple compression formats
- Cloud storage integration
- Backup retention policies
- Notification options

### 📚 Help &amp; Documentation

[](#-help--documentation)

```
# Get help and documentation for all commands
php artisan app:help

# Get help for a specific command
php artisan app:help app:init

# List all available commands
php artisan app:help --list

# Show usage examples
php artisan app:help app:deploy --examples

# Start interactive help mode
php artisan app:help --interactive

# Open beautiful HTML documentation in your browser
php artisan app:help --html
```

The help command provides comprehensive documentation, examples, and interactive guidance for all Laravel Initialization Utility commands.

[![HTML Documentation Screenshot](https://camo.githubusercontent.com/c5502087b27d709daa5fa8881c014f2718122f5633816c7b7456279eea70010c/68747470733a2f2f7669612e706c616365686f6c6465722e636f6d2f383030783435303f746578743d48544d4c2b446f63756d656e746174696f6e2b53637265656e73686f74)](https://camo.githubusercontent.com/c5502087b27d709daa5fa8881c014f2718122f5633816c7b7456279eea70010c/68747470733a2f2f7669612e706c616365686f6c6465722e636f6d2f383030783435303f746578743d48544d4c2b446f63756d656e746174696f6e2b53637265656e73686f74)*Beautiful HTML documentation with a modern, responsive design*

The HTML documentation provides a more visually appealing way to access the package's documentation, with features like:

- Modern, responsive design that works on all devices
- Syntax highlighting for code examples
- Easy navigation with a sidebar menu
- Detailed command documentation with examples
- Copy-to-clipboard functionality for code snippets

### 🔧 Application Initialization

[](#-application-initialization)

```
# Initialize the application
php artisan app:init

# Options:
#   --skip-requirements  Skip system requirements check
#   --skip-db           Skip database initialization
#   --skip-prepare      Skip application preparation
#   --skip-optimize     Skip application optimization
#   --force             Force the operation to run when in production
#   --show-config       Show database configuration and exit
#   --migrate           Run database migrations
#   --seed              Seed the database with records
```

### 💾 Database Management

[](#-database-management)

```
# Initialize and configure the database
php artisan db:init

# Options:
#   --show-config       Show database configuration and exit
#   --migrate           Run database migrations
#   --seed              Seed the database with records
#   --force             Force the operation to run when in production

# Execute MySQL commands directly
php artisan mysql:exec --command="SHOW TABLES;"

# List available predefined commands
php artisan mysql:exec --list-commands
```

### 🖥️ Development Server

[](#️-development-server)

```
# Start the development server
php artisan serve

# Or use the custom serve command with auto port selection
php artisan app:serve

# Options:
#   --host=127.0.0.1    The host address to serve the application on
#   --start-port=8001   The starting port number to try
#   --max-attempts=10   Maximum number of ports to try
#   --no-open           Do not open the browser automatically
```

### 🚀 Application Deployment

[](#-application-deployment)

```
# Prepare the application for deployment
php artisan app:deploy --prepare

# Set up the application after deployment
php artisan app:deploy --setup

# Options:
#   --exclude-vendor    Exclude vendor directory from deployment package
#   --exclude-node      Exclude node_modules directory from deployment package
#   --output=PATH       Specify output path for deployment package
```

### ⚡ Application Optimization

[](#-application-optimization)

```
# Optimize the application
php artisan app:optimize

# Options:
#   --no-vite           Skip Vite asset compilation
#   --no-cache          Skip cache rebuilding
#   --no-storage-link   Skip storage link creation
#   --production        Optimize for production environment
#   --dev               Optimize for development environment (default)

# Clean up the application
php artisan app:cleanup

# Options:
#   --force             Skip confirmation prompt
```

### 🔍 System Requirements Check

[](#-system-requirements-check)

```
# Check if your system meets all requirements
php artisan app:check-requirements
```

### 📝 Environment Preparation

[](#-environment-preparation)

```
# Prepare for development environment
php artisan app:prepare development

# Prepare for production environment
php artisan app:prepare production

# Options:
#   --clean             Remove unnecessary files
#   --permissions       Set appropriate file permissions
#   --optimize          Run optimization commands
```

✨ Features
----------

[](#-features)

### Interactive Setup Wizard

[](#interactive-setup-wizard)

- **User-Friendly Interface**: Configure your application with an interactive wizard
- **Feature Selection**: Pick and choose which features to use and configure
- **Documentation Viewer**: View README and help documentation directly in the console
- **Configuration Builder**: Generate configuration files for your selected options
- **Cross-Platform Support**: Works on Windows, macOS, and Linux

### Application Status

[](#application-status)

- **Comprehensive Status Check**: Get a complete overview of your application's status
- **Configuration Files**: Check for required configuration files
- **Environment Variables**: Verify environment variables are properly set
- **Package Detection**: Automatically detect installed Node and Composer packages
- **System Information**: View PHP, Laravel, Node.js, and server information

### Application Initialization

[](#application-initialization)

- **Complete Setup**: Initialize your Laravel application with a single command
- **System Requirements Check**: Verify your environment meets all requirements
- **Database Initialization**: Set up your database with proper character set and collation
- **Application Preparation**: Configure environment-specific settings
- **Permissions Management**: Set appropriate file and directory permissions

### Application Deployment

[](#application-deployment)

- **Deployment Package Creation**: Create optimized deployment packages
- **Post-Deployment Setup**: Configure your application after deployment
- **Customizable Exclusions**: Control which files are included in deployment packages

### Application Optimization

[](#application-optimization)

- **Cache Management**: Clear and rebuild various caches
- **Asset Compilation**: Compile frontend assets for production
- **Environment-Specific Optimization**: Different optimization strategies for development and production

### Application Cleanup

[](#application-cleanup)

- **Comprehensive Cleanup**: Clear all caches and optimize your application
- **Visual Progress Feedback**: See detailed progress of each cleanup step
- **Performance Metrics**: Track execution time for each operation

### Database Tools

[](#database-tools)

- **Database Initialization**: Create and configure databases with proper settings
- **Database Backup**: Create and manage database backups with various options
- **MySQL Command Execution**: Run MySQL commands directly from Artisan
- **Migration and Seeding**: Easily run migrations and seeders
- **Backup Compression**: Compress backups in various formats (SQL, GZ, ZIP)
- **Cloud Storage Integration**: Store backups in cloud storage services
- **Retention Policies**: Automatically manage backup retention

### Frontend Asset Management

[](#frontend-asset-management)

- **TailwindCSS Installation**: Easily install and configure TailwindCSS
- **Dark Mode Support**: Add dark mode support to your application
- **Plugin Integration**: Install and configure TailwindCSS plugins
- **Build Tool Detection**: Automatically detect and configure Vite or Laravel Mix

### Development Server

[](#development-server)

- **Port Auto-Detection**: Automatically finds the first available port
- **Browser Auto-Launch**: Opens your default browser to the application URL
- **Customizable Host**: Specify a custom host address
- **Cross-Platform Support**: Works on Windows, macOS, and Linux

🚀 Installation
--------------

[](#-installation)

[![Latest Stable Version](https://camo.githubusercontent.com/9a0679e2c2a1a62fb121b7e034f5e462a0846d65af7c352a57415d4c7aef56d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f657a2d69742d736f6c7574696f6e732f6c61726176656c2d696e69742e737667)](https://packagist.org/packages/ez-it-solutions/laravel-init)[![Total Downloads](https://camo.githubusercontent.com/9e04cc095c7883a452c45485d108f981bbab3045f84ff89bd50d9a53bcbfcd99/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f657a2d69742d736f6c7574696f6e732f6c61726176656c2d696e69742e737667)](https://packagist.org/packages/ez-it-solutions/laravel-init)[![License](https://camo.githubusercontent.com/c6298ccf32efba2594c9836b61be96189127300aba9a184eec76afb33d1e2658/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f657a2d69742d736f6c7574696f6e732f6c61726176656c2d696e69742e737667)](https://packagist.org/packages/ez-it-solutions/laravel-init)

### Requirements

[](#requirements)

- PHP 7.3 or higher
- Laravel 6.0 or higher
- Composer

### Option 1: Install via Composer (Recommended)

[](#option-1-install-via-composer-recommended)

Simply run the following command in your Laravel project:

```
composer require ez-it-solutions/laravel-init
```

That's it! The package will automatically register all commands with Laravel through auto-discovery.

### Option 2: Manual Installation

[](#option-2-manual-installation)

1. Clone the repository from our [GitHub repository](https://github.com/ez-it-solutions/laravel-init)

    ```
    git clone https://github.com/ez-it-solutions/laravel-init.git
    ```
2. Copy the `src` directory to your Laravel project
3. Register the service providers in your `config/app.php` file:

    ```
    'providers' => [
        // ...
        Ez_IT_Solutions\AppServe\AppServeServiceProvider::class,
        Ez_IT_Solutions\AppCleanup\AppCleanupServiceProvider::class,
        Ez_IT_Solutions\AppInit\AppInitServiceProvider::class,
        Ez_IT_Solutions\DatabaseTools\DatabaseToolsServiceProvider::class,
    ],
    ```
4. Publish the configuration files (optional):

    ```
    php artisan vendor:publish --tag=ez-it-solutions-config
    ```

    This will publish the following configuration files:

    - `config/init.php`: Configuration for initialization settings
    - `config/database.php`: Enhanced database configuration

### Compatibility

[](#compatibility)

This package is thoroughly tested and compatible with:

Laravel VersionPHP Version6.x7.3 - 8.27.x7.3 - 8.28.x7.3 - 8.29.x8.0 - 8.210.x8.1 - 8.2🎮 Command Showcase
------------------

[](#-command-showcase)

### App Cleanup Command

[](#app-cleanup-command)

```
╔═════════════════════════════════════════════════╗
║                                                 ║
║              INSTALLATION CLEANUP               ║
║                                                 ║
╚═════════════════════════════════════════════════╝

[1/10] Running: Clear Route Cache (route:clear)
 100% [===========================================] ✓ Done
Time: 0.23s

[2/10] Running: Clear Configuration Cache (config:clear)
 100% [===========================================] ✓ Done
Time: 0.18s

[3/10] Running: Clear Application Cache (cache:clear)
 100% [===========================================] ✓ Done
Time: 0.25s

```

### App Init Command

[](#app-init-command)

```
🚀 JC Portal Initialization
========================

🔍 Checking system requirements...
✅ PHP version: 8.2.0 (>= 8.1.0 required)

💾 Initializing database...
✅ Database 'laravel_db' initialized successfully

🔧 Preparing application...
📂 Ensuring required directories exist...
🔒 Setting file and directory permissions...
🔗 Creating storage symlink...
  ✓ Storage symlink created successfully
✅ Application preparation completed successfully

⚡ Optimizing application...
✅ Application has been initialized successfully!

```

📦 Creating Your Own Package
---------------------------

[](#-creating-your-own-package)

If you want to create your own version of this package, follow these steps:

### 1. Set Up Package Structure

[](#1-set-up-package-structure)

Create the following directory structure:

```
laravel-init/
├── config/
│   ├── database.php        # Enhanced database configuration
│   └── init.php           # Application initialization settings
├── src/
│   ├── Commands/
│   │   ├── AppCleanup.php              # Clean up application
│   │   ├── AppDeploy.php               # Deploy application
│   │   ├── AppHelpCommand.php          # Help documentation
│   │   ├── AppInit.php                 # Initialize application
│   │   ├── AppInstallTailwindCSS.php   # Install TailwindCSS
│   │   ├── AppOptimize.php             # Optimize application
│   │   ├── AppPrepare.php              # Prepare application
│   │   ├── AppServeCommand.php         # Serve application
│   │   ├── AppSetupCommand.php         # Interactive setup wizard
│   │   ├── AppWebSetupCommand.php      # Web-based setup wizard
│   │   ├── CheckRequirementsCommand.php # Check system requirements
│   │   ├── DatabaseBackupCommand.php    # Backup database
│   │   ├── DatabaseInitCommand.php      # Initialize database
│   │   ├── MysqlExecCommand.php         # Execute MySQL commands
│   │   └── StatusCommand.php            # Check application status
│   ├── Http/
│   │   └── Controllers/
│   │       ├── HelpController.php          # Help documentation controller
│   │       └── SetupWizardController.php   # Web setup wizard controller
│   ├── resources/
│   │   └── views/
│   │       ├── help/                      # Help documentation views
│   │       │   ├── index.blade.php
│   │       │   └── command.blade.php
│   │       ├── setup/                     # Web setup wizard views
│   │       │   ├── index.blade.php
│   │       │   ├── documentation.blade.php
│   │       │   ├── help.blade.php
│   │       │   ├── status.blade.php
│   │       │   ├── configure-app.blade.php
│   │       │   ├── setup-database.blade.php
│   │       │   ├── wizard-navigation.js
│   │       │   └── layout.blade.php
│   │       └── layout.blade.php           # Main layout template
│   ├── routes/
│   │   └── web.php                     # Web routes
│   ├── AppCleanupServiceProvider.php     # Cleanup service provider
│   ├── AppInitServiceProvider.php        # Init service provider
│   ├── AppServeServiceProvider.php       # Serve service provider
│   └── DatabaseToolsServiceProvider.php  # Database tools provider
├── composer.json
├── LICENSE
└── README.md

```

### 2. Create composer.json

[](#2-create-composerjson)

```
{
    "name": "ez-it-solutions/laravel-init",
    "description": "A comprehensive Laravel Initialization Utility that combines several functions and features specific to Laravel projects",
    "type": "library",
    "license": "MIT",
    "authors": [
        {
            "name": "Ez IT Solutions",
            "email": "info@ez-it-solutions.com"
        }
    ],
    "require": {
        "php": "^7.3|^8.0"
    },
    "require-dev": {
        "laravel/framework": "^6.0|^7.0|^8.0|^9.0|^10.0"
    },
    "autoload": {
        "psr-4": {
            "Ez_IT_Solutions\\AppServe\\": "src/",
            "Ez_IT_Solutions\\AppCleanup\\": "src/",
            "Ez_IT_Solutions\\AppInit\\": "src/",
            "Ez_IT_Solutions\\DatabaseTools\\": "src/"
        }
    },
    "extra": {
        "laravel": {
            "providers": [
                "Ez_IT_Solutions\\AppServe\\AppServeServiceProvider",
                "Ez_IT_Solutions\\AppCleanup\\AppCleanupServiceProvider",
                "Ez_IT_Solutions\\AppInit\\AppInitServiceProvider",
                "Ez_IT_Solutions\\DatabaseTools\\DatabaseToolsServiceProvider"
            ]
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}
```

### 3. Create Service Providers

[](#3-create-service-providers)

Create the following service provider files:

#### src/AppInitServiceProvider.php

[](#srcappinitserviceproviderphp)

```
