• Mahmoud Aglan's avatar
    fix(branches): stop the branch switcher 500ing on an unbuilt executive view · fc7060b9
    Mahmoud Aglan authored
    config/branch_lock.php names executive.dashboard as the lock's destination,
    but that route was never built. route() throws on an undefined name, so
    switching to "كل الفروع" crashed in production after the session had already
    been written — the user landed in all-branches mode via an error page.
    
    isLocked() already refused to lock without the route, and that was believed
    to make the whole feature dormant. It only made the *gating* dormant: the
    guard sits on the decision, while the crash is at the dereference. Four other
    sites turned the same name into a URL, and BranchSwitcher's was outside the
    gate entirely. Auth/Login reached it only through the config key, so it does
    not even contain the string "executive".
    
    Route every caller through BranchContext::redirectRouteName(), which returns
    the configured route when it exists and degrades to the dashboard when it
    does not. The dashboard is the right fallback while the view is unbuilt: the
    lock is dormant, so it is already unfiltered and showing the every-branch
    numbers the user asked for.
    
    The test pins the resolver in both directions and fails if any Livewire
    component or middleware reads branch_lock.redirect_route directly again.
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    fc7060b9
Name
Last commit
Last update
..
Activities Loading commit data...
Admin Loading commit data...
Assignments Loading commit data...
Attendance Loading commit data...
Audit Loading commit data...
Auth Loading commit data...
Branches Loading commit data...
CashSessions Loading commit data...
Components Loading commit data...
Concerns Loading commit data...
Dashboard Loading commit data...
Documents Loading commit data...
Enrollments Loading commit data...
Evaluations Loading commit data...
Events Loading commit data...
Facilities Loading commit data...
Financial Loading commit data...
Groups Loading commit data...
Guardian Loading commit data...
HR Loading commit data...
Inventory Loading commit data...
Invoices Loading commit data...
Messaging Loading commit data...
Notifications Loading commit data...
POS Loading commit data...
Parent Loading commit data...
Participants Loading commit data...
People Loading commit data...
Pricing Loading commit data...
Profile Loading commit data...
Programs Loading commit data...
Public Loading commit data...
Receptionist Loading commit data...
Reports Loading commit data...
Roles Loading commit data...
Schedule Loading commit data...
Settings Loading commit data...
Trainer Loading commit data...
Training Loading commit data...
Users Loading commit data...
Wallets Loading commit data...
Website Loading commit data...
WhatsApp Loading commit data...
Wizards Loading commit data...
BranchSwitcher.php Loading commit data...
Dashboard.php Loading commit data...
GlobalSearch.php Loading commit data...