Back to notes
The Tesseract MemoryTechnical note

Giving an announcement a start, an end or neither

WatchTube's Laravel scope combines an active switch with optional date limits, so the public page can select scheduled announcements without repeating the rules in Blade.

Topics

Each date answers a different question

An announcement doesn't always need a complete date range. It might need to appear from a particular day, disappear after one, or remain available until an editor switches it off. The WatchTube model represents those choices with an active flag and two nullable dates.

The active scope requires the flag first. It then accepts a start that is missing or no later than now, and an end that is missing or no earlier than now. Each null check is grouped with its own comparison, and both groups must pass. A missing start therefore doesn't bypass an expired end.

Select the content before rendering it

HomePage calls Announcement::active() while assembling its render data. Blade receives the selected records rather than deciding which announcements are eligible. The September 2025 change added the model, migration, Filament resource and page integration together, connecting the editor's fields to the public query.

This is a render-time decision, not a background notification. A page that's already open won't change just because the server clock crosses a date limit. Refreshing that view automatically would be separate work.

Announcement visibility selection

The editor supplies state and optional bounds; the home-page query derives the current result.

Direct callBlocked / denied
Editorial inputs
Model query
Page output

Scroll or drag the background to move. Use the zoom buttons to resize.Arrow keys move between components. Enter selects.

Choose a component to explore

Select a numbered component on the map or use the component menu. Its details and connections will appear here.

No component selected.

All connections (5)
  1. 01 · Filament editor02 · Announcement recordsave fields · Direct call
  2. 03 · Home-page render04 · Active query scopequery · Direct call
  3. 02 · Announcement record04 · Active query scopestate and bounds · Direct call
  4. 04 · Active query scope05 · Eligible announcementseligible · Direct call
  5. 04 · Active query scope06 · Excluded from this resultoutside window · Blocked / denied