Proje dosyaları eklendi

This commit is contained in:
2026-08-29 15:53:53 +03:00
commit d3313400ca
440 changed files with 24827 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace App\Support;
use App\Models\User;
use Illuminate\Http\Request;
final class PortalNavigationContext
{
public function resolve(Request $request): array
{
$webUser = auth('web')->user();
$earnMember = auth('earn')->user();
$isEarnContext = $request->routeIs('earn.*');
if ($isEarnContext && $earnMember) {
return ['kind' => 'earn', 'user' => $earnMember, 'panel_url' => route('earn.dashboard'), 'panel_label' => __('earn_portal.dashboard'), 'logout_route' => route('earn.logout')];
}
if (! $isEarnContext && $webUser instanceof User) {
$admin = $webUser->canAccessAdminPortal();
return ['kind' => 'web', 'user' => $webUser, 'panel_url' => $admin ? '/admin' : route('dashboard'), 'panel_label' => $admin ? __('landing.admin_panel') : __('landing.customer_panel'), 'logout_route' => route('logout')];
}
return ['kind' => 'guest', 'user' => null];
}
}