PHP code example of getecz / laravel-installer

1. Go to this page and download the library: Download getecz/laravel-installer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

getecz / laravel-installer example snippets


use Getecz\Installer\Http\Middleware\RedirectIfNotInstalled;
use Illuminate\Foundation\Configuration\Middleware;

return Application::configure(basePath: dirname(__DIR__))
    ->withRouting(
        web: __DIR__.'/../routes/web.php',
    )
    ->withMiddleware(function (Middleware $middleware) {
        $middleware->appendToGroup('web', RedirectIfNotInstalled::class);
    })
    ->create();

'redirect_after_install' => '/login'

'user_model' => \App\Models\User::class

'admin_fields' => [
  'name' => 'full_name',
  'email' => 'email',
  'password' => 'password',
],
'admin_defaults' => [
  'is_admin' => 1,
  'role' => 'admin',
],
bash
php artisan vendor:publish --tag=installer-config
php artisan vendor:publish --tag=installer-views