xgenious / installer
Laravel script installer package
Requires
- php: ^8.2
- laravel/framework: ^12.13.0 || ^13.0
- symfony/finder: ^7.0 || ^8.0
Requires (Dev)
- orchestra/testbench: ^10.0.0 || ^11.0.0
- phpunit/phpunit: ^11.5.55
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v2.9.1
- v2.9.0
- v2.8.2
- v2.8.1
- v2.8.0
- v2.7.0
- v2.6.1
- v2.6.0
- v2.5.1
- v2.5.0
- v2.4.0
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.0
- v1.6.0
- v1.5.0
- v1.4.0
- v1.3.0
- v1.2.0
- v1.0.17
- v1.0.16
- v1.0.15
- v1.0.14
- v1.0.13
- v1.0.12
- v1.0.11
- 1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-hasibur
- dev-adnan
This package is auto-updated.
Last update: 2026-11-20 17:30:28 UTC
README
A Laravel package for installing xgenious script easily with a visual installer
Requirements:
- PHP >= 8.2
- Laravel 12.x or 13.x
Installation
Require this package with composer:
composer require xgenious/installer
Publish the configuration file::
php artisan vendor:publish --provider="Xgenious\Installer\InstallerServiceProvider" --tag="config"
Register the middleware
Laravel 11/12 (bootstrap/app.php):
use Illuminate\Foundation\Configuration\Middleware; ->withMiddleware(function (Middleware $middleware) { $middleware->append(\Xgenious\Installer\Http\Middleware\InstallerMiddleware::class); })
Laravel 10 and older (app/Http/Kernel.php):
protected $middleware = [ // ... \Xgenious\Installer\Http\Middleware\InstallerMiddleware::class, ];
The middleware only registers the /install routes while the app has no
DB_CONNECTION in .env, so it is a no-op after installation.
Config Value Explanation
# config/installer.php return [ 'app_name' => 'Fundorex', //app name 'super_admin_role_id' => 3, // super admin role id 'admin_model' => \App\Admin::class, //admin modal 'admin_table' => 'admins', //admin table 'multi_tenant' => false, // show the PostgreSQL tenant layout selector when true 'author' => 'xgenious', // envato author username 'product_key' => '8de1f072836b127749b7aa2b575ffc0002ade20e', //product key from xgenious license server 'php_version' => '8.3', //minimum required php version 'database_type' => 'mysql', // mysql or pgsql (depending on product database type) // PostgreSQL tenant layout selector (pgsql + multi_tenant only). // Empty array hides the selector. 'database_layouts' => [ 'per_tenant' => 'Multi-database — one database per tenant', 'pooled' => 'Three shared databases — landlord + tenant (RLS) + horizon', ], 'database_layout' => 'per_tenant', // default selection // Product class that applies the selected layout after install. It must // expose apply(string $layout, array $db): array. Null disables it. 'install_callback' => null, 'extensions' => ['BCMath', 'Ctype', 'JSON', 'Mbstring', 'OpenSSL', 'PDO', 'pdo_mysql', 'Tokenizer', 'XML', 'cURL', 'fileinfo'], //required php extensions 'website' => 'https://xgenious.com', //author website url 'email' => 'support@xgenious.com', //support url 'env_example_path' => public_path('env-sample.txt'), //env-sample.txt file locaation, env will be generate based on this file contenant 'broadcast_driver' => 'log', // default config value 'cache_driver' => 'file', // default config value 'queue_connection' => 'sync', // default config value 'mail_port' => '587', // default config value 'mail_encryption' => 'tls', // default config value 'model_has_roles' => true, 'bundle_pack' => false, //if the product has bundle pack 'bundle_pack_key' => 'dsfasd', //bundle pack product key 'assets_dir' => 'assets', // sibling static-assets directory, if any 'license_env_check_timeout' => 4, // seconds for the .env exposure self-check ];
PostgreSQL tenant layouts
When the product uses PostgreSQL (database_type => 'pgsql') and
multi_tenant is true, the database step renders a layout selector with the
options configured in database_layouts. The selected key is sent as
database_layout and returned in the install response:
{
"type": "success",
"database_layout": "pooled",
"layout_ok": true,
"layout_note": "Run php artisan tenancy:pg-setup --mode=pooled to finish.",
"msg": "..."
}
The package deliberately does not know product-specific env keys,
databases, or migration commands. Point install_callback at a class in your
application:
'install_callback' => \App\Services\Installation\PostgresInstallationService::class,
The callback runs after the SQL dump import and admin creation, before caches are cleared, and receives:
public function apply(string $layout, array $db): array { // $db = [ // 'driver' => 'pgsql', // 'host' => '127.0.0.1', // 'port' => 5432, // 'name' => 'my_app', // 'username' => 'my_app', // 'password' => '...', // ] // Write app-specific env keys, create extra databases, etc. return [ 'ok' => true, 'message' => 'Run <code>php artisan tenancy:pg-setup --mode=pooled</code> to finish.', ]; }
message is returned as layout_note, appended to msg, and rendered on the
success screen (HTML is allowed because the callback is trusted product code).
Returning ok => false does not roll back the installation — it marks
layout_ok false and still shows the message, so the operator can fix the
remaining steps manually.
See CHANGELOG.md for release notes.
Migrate from old Installer
remove install folder, and remove install folder redirection from the root index.php file
Minimal .env File Required
here is example of minimal .env file.
APP_NAME=Fundorex APP_ENV=production APP_KEY=base64:8e5wSFpua5CzuHhXJEaJHcpRFBR2nqLAV0zTURuXgLA= APP_DEBUG=false APP_URL=http://fundorex.test/
Running Tests
To run the test suite for this package, follow these steps:
Ensure you have the package and its dependencies installed:
composer install
Copy the package's phpunit.xml.dist file to phpunit.xml:
cp phpunit.xml.dist phpunit.xml
Run the tests using PHPUnit:
./vendor/bin/phpunit
Or, if you've set up the Composer script, you can use:
composer test
For a coverage report, run:
./vendor/bin/phpunit --coverage-html coverage
This will generate an HTML coverage report in the coverage directory.
Notes:
The tests use an in-memory SQLite database by default. If you need to use a different database for testing, update the phpunit.xml file accordingly.
Some tests may require specific environment variables to be set. Check the phpunit.xml file and set any necessary variables in your local environment or in the phpunit.xml file.
If you encounter any issues running the tests, ensure that all dependencies are properly installed and that your PHP environment meets the package requirements.
Writing New Tests
When adding new features or fixing bugs, please add corresponding test cases. Place new test files in the tests directory, following the existing structure:
Unit tests go in tests/Unit
Feature tests go in tests/Feature
Ensure that your test class extends
Xgenious\Installer\Tests\TestCase.
If you need to add new test dependencies, add them to the require-dev section of the composer.json file.
Usages
When the .env file is not found in your Laravel application, this package will automatically display the installation wizard.