Search by

codalaya / php-project-install-wizard

codalaya

Web installer for Laravel products: requirements, permissions, database, optional purchase-code step and admin account. Records the installation in the database and locks itself afterwards.

Package info

github.com/codalaya/php-project-install-wizard

pkg:composer/codalaya/php-project-install-wizard

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2026-10-08 12:39 UTC

This package is not auto-updated.

Last update: 2026-10-09 01:23:10 UTC


README

A web installer for Laravel products (CodeCanyon-style "upload and open in the browser" installs).

Steps: Requirements & Permissions → Database → License (optional) → Admin account → Finish.

  • Checks the PHP version, extensions and folder permissions
  • Writes .env, generates APP_KEY, runs migrations and seeders (or imports a SQL dump)
  • Optional purchase-code step (plug in your own license check)
  • Creates the first admin account through your own handler class
  • Records the installation in the database and locks itself: once installed, every installer route returns 404
  • Until installed, every web request is redirected to the installer, with file sessions so it works before a database exists

Requires PHP 8.2+ and Laravel 11, 12 or 13.

Installation

composer require codalaya/laravel-installer
php artisan vendor:publish --tag=codalaya-installer

The publish step copies config/install.php, the views (resources/views/vendor/installer) and the assets (public/install). Open your site in the browser and the installer starts at /install-app.

Configuration (config/install.php)

Key What it does
install_title, colors Installer heading and colours
version, table Version recorded in the installations table (default app_installations)
redirect_when_not_installed Send every web request to the installer until installed
redirect_after Where Finish lands (e.g. /login)
database.seed, database.database_path Seed after migrating, or import a SQL dump instead
core.minPhpVersion, requirements, permissions What the first step checks
account, account_fields Validation rules and form fields of the admin account step
account_handler Class implementing Codalaya\LaravelInstaller\Contracts\CreatesInstallAccount that creates the admin user
license_handler Optional purchase-code step, see below; null skips it

Admin account

use Codalaya\LaravelInstaller\Contracts\CreatesInstallAccount;

class CreateAdminAccount implements CreatesInstallAccount
{
    public function create(array $data): ?int
    {
        $user = \App\Models\User::create([...$data, 'password' => bcrypt($data['password'])]);
        $user->assignRole('admin');

        return $user->id;
    }
}

Only the fields validated by install.account reach create().

License step

Point license_handler at a class with these static methods:

class License
{
    public static function host(): string;                 // this site's domain
    public static function isLocal(string $host): bool;    // true = the code is optional here
    public static function activate(string $code): array;  // throw ValidationException (key "purchase_code") to refuse
}

On a live domain the step can't be skipped. On local and staging hosts the code is optional.

Checking the installation in your app

use Codalaya\LaravelInstaller\Main\InstalledManager;

InstalledManager::isInstalled();   // bool
InstalledManager::record();        // the installations row (version, installed_at, …) or null

License

MIT. See LICENSE.