amdadulshakib/installer

Laravel Installer Package

v1.0.2 2025-07-09 16:48 UTC

This package is not auto-updated.

Last update: 2025-07-09 20:07:53 UTC


README

A clean and easy-to-use Laravel installation wizard with environment setup, database import, admin user creation, and project locking system โ€” perfect for CodeCanyon and distributable Laravel apps.

๐Ÿš€ Features

  • Welcome screen
  • System requirements checker
  • .env environment setup form
  • Database connection test & SQL file import (no migration)
  • Admin user creation
  • Installed lock file system
  • UI-based installation wizard
  • Middleware protection for installed state
  • Publishable views & assets

๐Ÿ“‚ Folder Structure Overview

packages/
โ””โ”€โ”€ amdadulshakib/
    โ””โ”€โ”€ Installer/
      โ””โ”€โ”€ src
          โ”œโ”€โ”€ Controllers/
          โ”œโ”€โ”€ Middleware/
          โ”œโ”€โ”€ routes/
          โ”œโ”€โ”€ resources/
          โ”‚   โ””โ”€โ”€ views/
          โ”œโ”€โ”€ routes/
          โ”‚   โ””โ”€โ”€ web.php
          โ”œโ”€โ”€ helper.php
          โ”œโ”€โ”€ InstallerServiceProvider.php
          โ””โ”€โ”€ composer.json

๐Ÿงฉ Installation

Option 1: Use from GitHub

Add this to your project's composer.json:

"repositories": [
  {
    "type": "vcs",
    "url": "https://github.com/amdadulshakib/laravel-project-installer"
  }
]

Then run:

composer require amdadulshakib/installer

Option 2: Use Locally (For development)

Add this to your composer.json:

"repositories": [
  {
    "type": "path",
    "url": "packages/amdadulshakib/Installer"
  }
]

Then install:

composer require amdadulshakib/installer:@dev

โš™๏ธ Publish Assets and Views

php artisan vendor:publish --tag=installer-views
php artisan vendor:publish --tag=installer-assets

๐Ÿ›ก๏ธ Middleware

This package auto-registers a middleware install.lock that prevents accessing the app before installation.

You can apply globally using:

$this->app['router']->pushMiddlewareToGroup('web', \amdadulshakib\Installer\Middleware\IsNotInstalled::class);

Middleware Logic:

  • If /storage/installed.lock does not exist, it redirects to /install
  • After successful installation, the lock file is created
  • Trying to access /install again after installation is blocked

๐Ÿงช SQL Import Instead of Migrations

The package does not use migrations. Instead, it imports database.sql from:

packages/amdadulshakib/Installer/database/database.sql

Place your pre-built SQL dump file here to set up the database during installation.

โœ๏ธ Usage Steps

  1. Visit /install
  2. Go through:
    • Welcome
    • Requirements check
    • Environment setup
    • Database setup (will import database.sql)
    • Admin user creation
    • Finish
  3. After installation, a storage/installed.lock file will be created
  4. Any access to /install after installation will be blocked

๐ŸŽจ Styling

To include CSS or JS:

  1. Place files in packages/amdadulshakib/Installer/public/
  2. Publish them using:
php artisan vendor:publish --tag=installer-assets
  1. Use in views:
<link rel="stylesheet" href="{{ asset('vendor/installer/css/installer.css') }}">
<script src="{{ asset('vendor/installer/js/installer.js') }}"></script>

๐Ÿ“ฆ License

Open-source and customizable for commercial or private Laravel projects.

โค๏ธ Author

Amdadul Shakib
GitHub Profile