codelone / laravel-web-installer
Advanced web installer for Laravel applications with license verification and database schema import capabilities
Requires
- php: ^8.1|^8.2|^8.3
- filament/filament: ^3.0
- guzzlehttp/guzzle: ^7.0
- laravel/framework: ^10.0|^11.0
- livewire/livewire: ^3.0
- spatie/laravel-package-tools: ^1.14
Requires (Dev)
- laravel/pint: ^1.0
- mockery/mockery: ^1.4
- orchestra/testbench: ^8.0|^9.0
- phpunit/phpunit: ^10.0
README
A beautiful and powerful web installer for Laravel applications with advanced features including license verification, database schema import, and real-time installation progress tracking.
Features
- 🔐 License Verification - API-based license validation with domain binding
- 🗄️ Database Schema Import - Import pre-configured database schemas from license server
- 📊 Real-time Progress - Beautiful progress tracking with live updates
- 🔧 Server Requirements - Comprehensive PHP and server requirement checking
- 📁 Permissions Validation - Automatic folder permission verification
- 🎨 Filament UI - Beautiful, modern interface built with Filament
- 🔄 Fallback System - Automatic fallback to standard Laravel installation
- 👤 Admin User Creation - Automatic creation of default admin users
- 🌐 Multi-step Wizard - Intuitive step-by-step installation process
- 📱 Responsive Design - Works perfectly on all devices
Screenshots
Installation
You can install the package via Composer:
composer require codelone/laravel-web-installer
Quick Start
1. Basic Setup
After installing the package, publish the configuration (optional):
php artisan vendor:publish --provider="CodeLone\LaravelWebInstaller\WebInstallerServiceProvider" --tag="config"
2. Environment Configuration
Add the following to your .env
file:
# License API Configuration INSTALLER_LICENSE_API_URL=https://api.yourdomain.com/verify-license INSTALLER_PRODUCT_ID=1
3. Application Protection
Add installation protection to your main routes:
// routes/web.php Route::get('/', function () { // Check if application is installed if (!file_exists(storage_path('installed'))) { return redirect()->route('installer'); } return view('welcome'); }); // Protect your application routes Route::middleware(['redirect.if.not.installed'])->group(function () { // Your protected application routes here Route::get('/dashboard', [DashboardController::class, 'index']); // ... other routes });
4. Access the Installer
Visit /installer
in your browser to start the installation process.
Configuration
License API Setup
The package supports license verification through a REST API. Your license server should accept POST requests with the following format:
{ "license_key": "your-license-key", "product_id": 1, "domain": "yourdomain.com" }
And respond with:
{ "success": true, "license_status": "active", "license_id": "123", "product_id": 1, "domain": "yourdomain.com", "expires_at": "2024-12-31", "product_data": "SQL schema content here (optional)" }
Custom Steps
You can customize the installation steps by modifying the configuration:
// config/installer.php 'steps' => [ \CodeLone\LaravelWebInstaller\Forms\ServerRequirementFields::class, \CodeLone\LaravelWebInstaller\Forms\FolderPermissionStep::class, \CodeLone\LaravelWebInstaller\Forms\LicenseVerificationFields::class, \CodeLone\LaravelWebInstaller\Forms\CustomEnvironmentFields::class, \Your\Custom\StepClass::class, // Add your custom steps ],
Custom Installation Manager
Create your own installation manager by implementing the InstallationContract
:
use CodeLone\LaravelWebInstaller\Concerns\InstallationContract; class MyCustomInstallationManager implements InstallationContract { public function run(array $data): bool { // Your custom installation logic return true; } public function redirect() { return redirect('/my-custom-redirect'); } public function dehydrate(): void { // Cleanup logic } }
Then update your configuration:
// config/installer.php 'installation_manager' => \App\Installers\MyCustomInstallationManager::class,
Advanced Features
Database Schema Import
The package can automatically import database schemas from your license server:
- Include
product_data
(SQL content) in your license API response - The installer will save this as a temporary SQL file
- During installation, it will import the schema with transaction safety
- Progress is tracked and displayed in real-time
Server Requirements
Customize server requirements:
// config/installer.php 'core' => [ 'minPhpVersion' => '8.1.0', ], 'requirements' => [ 'php' => [ 'openssl', 'pdo', 'mbstring', 'tokenizer', 'JSON', 'cURL', 'fileinfo', 'zip', 'gd', // Add custom requirements ], 'apache' => [ 'mod_rewrite', 'mod_ssl', // Add custom requirements ], ],
Folder Permissions
Customize folder permission checks:
// config/installer.php 'permissions' => [ 'storage/framework/' => '755', 'storage/logs/' => '755', 'bootstrap/cache/' => '755', 'storage/app/' => '755', 'public/uploads/' => '775', // Add custom folders ],
Customization
Views
Publish and customize the views:
php artisan vendor:publish --provider="CodeLone\LaravelWebInstaller\WebInstallerServiceProvider" --tag="views"
Views will be published to resources/views/vendor/laravel-web-installer/
.
Translations
Publish and customize the language files:
php artisan vendor:publish --provider="CodeLone\LaravelWebInstaller\WebInstallerServiceProvider" --tag="translations"
Assets
Publish and customize the assets:
php artisan vendor:publish --provider="CodeLone\LaravelWebInstaller\WebInstallerServiceProvider" --tag="assets"
API Reference
Installation Contract
interface InstallationContract { public function run(array $data): bool; public function redirect(); public function dehydrate(): void; }
Step Contract
interface StepContract { public static function form(): array; public static function make(): Step; }
Events
The package fires several events during installation:
InstallationStarted
- When installation beginsLicenseVerified
- When license verification succeedsSchemaImported
- When database schema import completesInstallationCompleted
- When installation finishesInstallationFailed
- When installation fails
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
Support
- 📧 Email: support@codelone.dev
- 💬 Discord: Join our community
- 📖 Documentation: Full documentation
- 🐛 Bug Reports: GitHub Issues
Made with ❤️ by CodeLone