jmrashed / laravel-installer
A complete web installer for Laravel applications, making the setup process simple and user-friendly.
Requires
- php: >=7.0.0
Suggests
- jmrashed/laravel-core-application-service: To extend functionality with core application services.
README
Laravel Installer is a complete package designed to simplify the installation process for Laravel projects. This installer handles system requirement checks, environment configuration, database setup, and purchase code validation.
π Statistics
π Features
- System Requirements Check: Automatically verifies PHP version and required extensions.
- Environment File Setup: Helps create and configure the
.env
file. - Database Configuration: Offers the option to run migrations, seeders, or import an SQL dump.
- Purchase Code Validation: Built-in validation for purchase codes.
- User-Friendly Interface: A guided step-by-step installation process with a simple interface.
π οΈ Installation
To install the package, run the following command:
composer require jmrashed/laravel-installer
Then, publish the configuration file:
php artisan vendor:publish --tag=installer-config
π How to Use
After installation, run the installer using:
php artisan installer:run
The installer will guide you through these steps:
- System Requirements Check: Ensures the necessary PHP version and extensions are installed.
- Environment File Setup: Prompts for database credentials and generates the
.env
file. - Database Setup: Choose to run migrations and seeders or import a SQL dump.
- Purchase Code Validation: If enabled, the user is required to enter their purchase code.
- Completion: Confirms successful installation.
π Directory Structure
Hereβs a simplified structure of the project directories and key files:
- π src/
- π Config/
- π installer.php
- π Controllers/
- π DatabaseController.php
- π EnvironmentController.php
- π Events/
- π EnvironmentSaved.php
- π LaravelInstallerFinished.php
- π Helpers/
- π DatabaseManager.php
- π EnvironmentManager.php
- π Middleware/
- π canInstall.php
- π canUpdate.php
- π Providers/
- π LaravelInstallerServiceProvider.php
- π Routes/
- π web.php
- π Views/
- π layouts/
- π master-update.blade.php
- π master.blade.php
- π update/
- π finished.blade.php
- π overview.blade.php
- π environment-classic.blade.php
- π environment-wizard.blade.php
- π assets/
- π css/
- π style.css
- π style.css.map
- π fonts/
- π FontAwesome.otf
- π fontawesome-webfont.eot
- π img/
- π favicon/
- π favicon-16x16.png
- π favicon-32x32.png
- π background.png
- π pattern.png
- π LICENSE
- π README.md
βοΈ Configuration
The published configuration file can be found at:
config/installer.php
This allows you to customize checks and paths, such as setting the SQL dump path for import during installation.
π₯ Purchase Code Validation
If your system requires purchase code validation, you can customize the validation logic in the validatePurchaseCode
function. Hereβs an example:
if (!$this->validatePurchaseCode($code)) { throw new Exception('Invalid purchase code.'); }
π· Screenshots
π§ System Requirements
To ensure the Laravel Installer works as expected, your environment must meet the following requirements:
- PHP: 8.0 or higher
- Laravel: 9.0 or higher
- PHP Extensions:
mbstring
openssl
pdo
tokenizer
xml
ctype
json
π€ Contributing
Contributions are welcome! If you want to contribute:
- Fork the repository.
- Create a new feature branch:
git checkout -b feature-branch
. - Commit your changes:
git commit -m 'Add new feature'
. - Push to the branch:
git push origin feature-branch
. - Open a pull request on GitHub.
π License
This package is licensed under the MIT license.
π¬ Support
For support, feel free to open an issue on the GitHub repository or contact us directly.