PHP code example of olakunlevpn / laravel-installer-account

1. Go to this page and download the library: Download olakunlevpn/laravel-installer-account 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/ */

    

olakunlevpn / laravel-installer-account example snippets


// Configure default admin role
ACCOUNT_DEFAULT_ROLE=admin
ACCOUNT_STEP_POSITION=5

// User fills in:
// - Name
// - Email
// - Password
// - Password confirmation

// Package stores in session until database ready
// After migrations, saves to users table

Schema::create('users', function (Blueprint $table) {
    $table->id();
    $table->string('name');
    $table->string('email')->unique();
    $table->string('password');
    $table->string('role')->default('user'); // Optional
    $table->timestamps();
});

// If license package installed
// Email auto-fills from license step
// Saves time for users

// Laravel's default migration already e column if needed:
$table->string('role')->default('user');

'default_role' => 'admin',
'role_column' => 'role',

'default_role' => 1,
'role_column' => 'role_id',

'default_role' => null,
bash
php artisan vendor:publish --tag=laravel-installer-account-config
bash
php artisan vendor:publish --tag=laravel-installer-account-views
bash
php artisan vendor:publish --tag=laravel-installer-account-translations