@include('shared.toastr') @php $order = ['welcome','general','theme','database','admin','finish']; $steps = [ 'welcome' => ['title'=>'Requirements','desc'=>'Files, extensions and classes'], 'general' => ['title'=>'MT4 Setup','desc'=>'Application and API credentials'], 'theme' => ['title'=>'Theme','desc'=>'Website and client design'], 'database' => ['title'=>'Database','desc'=>'Connect, migrate and seed'], 'admin' => ['title'=>'Super Admin','desc'=>'Owner login and permissions'], 'finish' => ['title'=>'Install','desc'=>'Finalize and secure'], ]; $currentIndex = array_search($step,$order,true); $databaseDisplay = trim(($database['db_database'] ?? $databaseName ?? '').'@'.($database['db_host'] ?? $databaseHost ?? ''),'@'); $installMode = old('install_mode',$database['install_mode'] ?? 'fresh'); $isFreshInstall = ($database['install_mode'] ?? 'fresh') === 'fresh'; $roleMode = old('role_mode',$selectedRoleMode ?? ($admin['role_mode'] ?? 'auto')); $roleId = old('role_id',$selectedRoleId ?? ($admin['role_id'] ?? null)); if($isFreshInstall){ $roleMode = 'auto'; $roleId = null; } $selectedRoleName = 'Create / update Super Admin with every web permission'; if(!$isFreshInstall && ($admin['role_mode'] ?? null)==='existing' && !empty($admin['role_id'])){ $selected = ($roles ?? collect())->firstWhere('id',(int)$admin['role_id']); $selectedRoleName = $selected?->name ?? 'Existing role #'.$admin['role_id']; } $requiredFailed = collect($preflight ?? [])->where('required',true)->where('ok',false)->count(); @endphp
M4
MT4 Platform InstallerMulti-account brokerage administration and client portal
Complete browser-based installation
@if($step === 'welcome')
Step 1 of 6

Server preflight

The installer validates required PHP extensions, writable paths, Laravel classes, the MT4 integration service, and the permission package before touching the database.

PHP
{{ PHP_VERSION }}
Laravel
{{ app()->version() }}
Existing database
{{ $dbConnected ? 'Connected' : 'Not connected yet' }}
Preflight result
{{ $requiredFailed ? $requiredFailed.' required item(s) failed' : 'All required checks passed' }}
@foreach($preflight as $item)
{{ $item['label'] }}{{ $item['detail'] }}
@endforeach
@if($dbError)
The current .env database is unavailable, which is normal for a new installation: {{ $dbError }}
@endif @endif @if($step === 'general')
Step 2 of 6

Application and MT4 API

Configure the platform identity and the server-side credentials used for every account, trade, price, chart, group, balance, credit, and order request.

@csrf
The MT4 provider uses server-side HTTP GET requests. API name and pass never come from browser input. Complete Pusher credentials enable private live contact-message notifications; incomplete credentials are rejected.
Back
@endif @if($step === 'theme')
Step 3 of 6

Select the complete visual theme

Choose a website theme, then select a design for the client panel and sign-in pages.

@csrf
@foreach($themes as $slug => $theme) @endforeach
@include('shared.client-presentation-select', [ 'inputId' => 'install_client_presentation', 'inputName' => 'client_presentation', 'currentMode' => old('client_presentation', $selectedClientPresentation), ])
Back
@endif @if($step === 'database')
Step 4 of 6

Database installation

Fresh mode resets the selected database, then runs every migration and deterministic seeder. Existing mode preserves current rows, applies all pending MT4/theme migrations, and refreshes idempotent metadata.

@csrf
Create the MySQL database before this step. The installer creates and upgrades tables, but intentionally does not create the database itself.
Back
@endif @if($step === 'admin')
Step 5 of 6

Create the super admin

The installer creates or updates the owner account, verifies permission tables, synchronizes every web permission to the Super Admin role, and clears the permission cache.

@csrf
@if($isFreshInstall)
Fresh mode resets the role tables. The installer will create or update the Super Admin role after migration and synchronize every seeded web permission to it.
@else
@if(($roles ?? collect())->isNotEmpty()) @endif
@if(($roles ?? collect())->isNotEmpty())
@else
No existing web roles were found. The installer will create the Super Admin role and assign all seeded permissions.
@endif @endif
Back
@if(!$isFreshInstall && ($roles ?? collect())->isNotEmpty()) @endif @endif @if($step === 'finish')
Step 6 of 6

Ready to deploy

Review the configuration. The final operation creates the schema, seeds permissions and themes, activates the selected design, creates the owner, writes a secure application key, and locks the installer.

Application{{ $general['app_name'] ?? config('app.name') }}
URL / timezone{{ $general['app_url'] ?? config('app.url') }} · {{ $general['timezone'] ?? config('app.timezone') }}
MT4 API{{ rtrim($general['mt4_api_base_url'] ?? '', '/') }}{{ $general['mt4_api_endpoint'] ?? '' }} · credentials configured
Live messages{{ !empty($general['pusher_app_id']) && !empty($general['pusher_app_key']) && !empty($general['pusher_app_secret']) ? 'Pusher private channels configured' : 'Pusher not configured; database messages remain available' }}
Website theme{{ $selectedThemeData['name'] ?? $selectedTheme }}
Client panel and sign-in pages{{ $selectedClientPresentation === 'matched' ? 'Theme-matched' : 'Legacy' }}
Database{{ $databaseDisplay }}
Install mode{{ ($database['install_mode'] ?? 'fresh')==='fresh' ? 'Fresh: reset schema, migrate and seed safe metadata' : 'Upgrade: preserve data and apply pending migrations' }}
Super admin{{ $admin['email'] ?? 'Not saved' }}
Role{{ $selectedRoleName }}
No MT4 password or API credential is rendered into client-side JavaScript. The final environment file is server-side and should remain outside public web access.
@csrf
Back
@endif