@php $isWbRequest = request()->is('website-builder*') || request()->is('*agency-admin*') || str_contains(request()->getHost(), 'websitebuilder'); @endphp @if ($isWbRequest) @include('errors.working_on_it', [ 'is404' => true, 'errorTitle' => 'Looking for Something? We Are On It!', 'errorSubtitle' => 'The page or link you tried to access is currently unavailable, has been relocated, or is undergoing an update. All platform features and servers are working normally.' ]) @php return; @endphp @endif @php $layoutDirectory = null; $pageTitle = null; try { if (isset($currentLang) && $currentLang && \Illuminate\Support\Facades\Schema::hasTable('headings')) { $pageTitle = App\Models\Admin\Heading::where('language_id', $currentLang->id)->pluck('not_found_title')->first(); } } catch (\Throwable $e) { $pageTitle = null; } $user = App\Models\User::where('username', getParam())->first(); $userCurrentLang = null; if ($user) { $userCurrentLang = app('userCurrentLang'); if (empty($userCurrentLang)) { $userCurrentLang = App\Models\User\Language::where('user_id', $user->id)->orderBy('id', 'asc')->first(); } if ($userCurrentLang) { $pageTitle = App\Models\User\UserHeading::where([ ['language_id', $userCurrentLang->id], ['user_id', $user->id], ]) ->pluck('not_found_page') ->first(); } } $layoutDirectory = !is_null($user) && !empty($userCurrentLang) ? 'user-front.layout' : 'front.layout'; $breadcrumb_title = !is_null($user) ? 'breadcrumb_title' : 'breadcrumb-title'; $breadcrumb_link = !is_null($user) ? 'page-title' : 'breadcrumb-link'; @endphp @extends($layoutDirectory) @section('pagename') - {{ $pageTitle ?? __('404') }} @endsection @section($breadcrumb_title) {{ $pageTitle ?? __('404') }} @endsection @section($breadcrumb_link) {{ $pageTitle ?? __('404') }} @endsection @section('content')
@if ($layoutDirectory == 'user-front.layout') @php $user = app('user'); $data = null; $image = null; if ($user && !empty($userCurrentLang)) { $data = DB::table('user_basic_extendes') ->where([['user_id', $user->id], ['language_id', $userCurrentLang->id]]) ->select('user_not_found_title', 'user_not_found_subtitle') ->first(); $image = DB::table('user_basic_settings') ->where('user_id', $user->id) ->pluck('page_not_found_image') ->first(); } @endphp @if (!is_null($image)) @else @endif @else @endif
@if ($layoutDirectory == 'user-front.layout') @php $keywords = ($user && isset($user->id)) ? App\Http\Helpers\Common::get_keywords($user->id) : []; @endphp

{{ $data->user_not_found_title ?? ($keywords['youare_lost'] ?? __("You're lost")) }}...

{{ $data->user_not_found_subtitle ?? ($keywords['The page you are looking for might have been moved, renamed, or might never have existed.'] ?? __('The page you are looking for might have been moved, renamed, or might never have existed.')) }}

{{ $keywords['Back Home'] ?? __('Back Home') }} @else @php if (session()->has('lang')) { app()->setLocale(session()->get('lang')); } else { $defaultLang = App\Models\Language::where('is_default', 1)->first(); if (!empty($defaultLang)) { app()->setLocale($defaultLang->code); } } @endphp

{{ __("You're lost") }}...

{{ __('The page you are looking for might have been moved, renamed, or might never existed.') }}

{{ __('Back Home') }} @endif
@php $showDiagnostics = config('app.debug') || request()->has('debug'); @endphp @if ($showDiagnostics) @php $dbStatusInfo = 'Unknown'; $activeDbName = 'Unknown'; $usersCountInActiveDb = 0; try { DB::connection()->getPdo(); $dbStatusInfo = 'CONNECTED & ONLINE'; $activeDbName = DB::connection()->getDatabaseName(); $usersCountInActiveDb = DB::table('users')->count(); } catch (\Throwable $dbe) { $dbStatusInfo = 'DB ERROR: ' . e($dbe->getMessage()) . ''; } $paramVal = getParam(); $foundUserObj = app()->bound('user') ? app('user') : null; $foundUserDb = null; $userLangCount = 0; $userCurrCount = 0; $hasBsSetting = 'NO'; try { if ($foundUserObj) { $foundUserDb = $foundUserObj; } elseif (!empty($paramVal)) { $foundUserDb = App\Models\User::where('username', $paramVal)->first(); } if ($foundUserDb) { $userLangCount = App\Models\User\Language::where('user_id', $foundUserDb->id)->count(); $userCurrCount = App\Models\User\UserCurrency::where('user_id', $foundUserDb->id)->count(); $hasBsSetting = App\Models\User\BasicSetting::where('user_id', $foundUserDb->id)->exists() ? 'YES' : 'NO'; } } catch (\Throwable $uerr) {} @endphp
🐞 Live Database & System Diagnostics (404 Debug)

🔌 Database Connection: {!! $dbStatusInfo !!}

🗄️ Active Database Name: {{ $activeDbName }}

👥 Total Users in Active DB: {{ $usersCountInActiveDb }}

🌐 HTTP Host: {{ $_SERVER['HTTP_HOST'] ?? 'N/A' }}

🔗 Request Path: {{ request()->path() }}

🔍 URL Parameter (getParam): {{ json_encode($paramVal) }}

👤 Tenant User Status: @if ($foundUserDb) FOUND (ID: {{ $foundUserDb->id }}, Username: {{ $foundUserDb->username }}) @else NOT FOUND in Active Database @endif

@if ($foundUserDb)

🌐 User Languages Count: {{ $userLangCount }}

💱 User Currencies Count: {{ $userCurrCount }}

⚙️ Basic Settings Record: {{ $hasBsSetting }}

🎨 Preview Template: {{ $foundUserDb->preview_template ?? 0 }}

@endif
@if (isset($exception) && $exception instanceof \Throwable)
⚠️ Detailed Exception & Trace:

Exception Class: {{ get_class($exception) }}

Error Message: {{ $exception->getMessage() }}

Triggered In: {{ $exception->getFile() }}:{{ $exception->getLine() }}

Route Name: {{ request()->route() ? request()->route()->getName() : 'N/A' }}

Action Controller: {{ request()->route() ? request()->route()->getActionName() : 'N/A' }}

📜 Call Stack Trace:

{{ $exception->getTraceAsString() }}
@endif
@endif @endsection