• Mahmoud Aglan's avatar
    feat(branches): make "all branches" a state the app can actually hold · 48a79a76
    Mahmoud Aglan authored
    Session::has() is `! is_null(get($key))`, so it reports false for a key
    holding null — which is exactly how "all branches" was stored. Three
    call sites tested presence that way, so selecting كل الفروع silently
    reverted to a single branch on the next navigation and isAllBranches()
    was unreachable dead code. All three now use exists().
    
    BranchContext is the one place that reads that state. It lives in
    Context, not Services, because the project rule keeps services free of
    session/auth so they stay queue-safe; this is the adapter that turns
    request state into the explicit ?int $branchId services receive. A null
    left by a user whose permission was revoked is repaired rather than
    honoured, and stamping deliberately does not follow branchId() — API
    routes and queued listeners run outside the request, and a record filed
    against no branch would vanish from every per-branch total for good.
    
    The lock itself is dormant on purpose: isLocked() returns false while
    the executive dashboard route does not exist, since locking would
    otherwise 500 every page including its own redirect target. The
    permission ships as a migration as well as a seeder entry, because
    db:seed only runs when RUN_SEED_ON_FIRST_DEPLOY is set.
    
    Also stops enabling the query log outside debug — it retained every
    statement of every request in production memory for nothing.
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    48a79a76
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...
cash-sessions Loading commit data...
components 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...
parent Loading commit data...
participants Loading commit data...
people Loading commit data...
pos 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...
branch-switcher.blade.php Loading commit data...
dashboard.blade.php Loading commit data...
global-search.blade.php Loading commit data...