Warp

Fill the gaps in a café staff rota, in Filament

5 min read

A café by the harbour has four full-time staff and six part-timers. Lunch is busy when there are many table bookings, and the evenings are quiet, except when they are not. The manager plans the month in a spreadsheet: a code per person per day, OP for opening, MD for middle, CL for closing. What the spreadsheet does not say is whether there are enough people at two o'clock on Monday, or that the part-timer who just got an extra shift is now working ten days in a row.

This article shows the same month with Warp Shift: the roster counts the people working in each part of the day against what is needed, a day opens as bars on a timeline, and every change is checked against the café's rules as it is made. All pictures are from the live demo.

The scene: a month, with the gaps in red

The roster looks like the spreadsheet: staff down the side, days across, a code in each cell. Under the staff, rows count the people working in each part of the day against how many are needed. A red cell is a gap: on Monday the 2nd, 11 to 14 has 2 people where 5 are needed.

The November 2026 roster of the Harbor café: full-time and part-time staff with codes CL, MD, OP and O per day, days, hours and weekend totals on the right, and rows at the bottom such as 11-14 Anyone working with counts like 2/5 in red
November at the Harbor café. The bottom rows count working / needed for each part of the day; red means short.

Step 1: describe the roster

The roster is a page class. Its static roster() says who is on it, which codes can be typed and where the numbers come from. This is the demo's, a little shortened:

use Qalainau\FilamentWarpShift\Pages\ShiftRoster;
use Qalainau\FilamentWarpShift\Roster;

class CafeRoster extends ShiftRoster
{
    public static function roster(Roster $roster): Roster
    {
        return $roster
            ->staff(User::class)
            ->staffQuery(fn (Builder $query, string $shop) => $query->where('ward', $shop)->orderBy('team'))
            ->scopes(fn () => ['harbor' => 'Harbor café', 'station' => 'Station café'])
            ->codes(['OP', 'MD', 'CL', 'O'])
            // Typing 10-15 in an empty cell makes a Middle shift at those times
            ->timeCode('MD')
            // 45 minutes of break over 6 hours, an hour over 8 hours
            ->breaks(fn (int $minutes) => $minutes > 480 ? 60 : ($minutes > 360 ? 45 : 0))
            // Staff needed at lunch from the day's table bookings, not typed on the roster
            ->requirements(fn (CarbonImmutable $date, string $shop) => CafeBookings::staffNeeded($date, $shop))
            ->rules([
                MaxConsecutiveDays::make(5),
                MinRestHours::make(10)->warn(),
                MaxHours::make(fn (User $user) => $user->contract_hours)->warn(),
            ]);
    }
}

requirements() is the interesting line: the number of people needed comes from your own data (here, the table bookings of the day), so the roster turns red when bookings come in, not when someone remembers to update it.

Step 2: open the day

Click a day, and it opens as a timeline: a bar per shift, and on top, people working against people needed, hour by hour. On Monday the 2nd, the red is clear: 13:00 to 16:00 and 17:00 to 20:00.

The timeline of Mon, Nov 2: a Working / needed chart with red from 13 to 16 and from 17 to 20, and bars for Ruth Ellis MD 11-17, Diego Ramos MD 11-17, Anna Novak OP 7-13, Tom Becker CL 16-22, Marco Bianchi OP 7-13 and Jonas Berg CL 16-22; the part-timers have a day off
Monday the 2nd, hour by hour. Red is where fewer people work than are needed.

Step 3: drag a shift longer

Tom closes at 22:00. The manager drags the left end of his bar from 16:00 to 13:00, and the afternoon gap is gone.

The same timeline after the drag: Tom Becker's bar is now CL 13-22 and the chart is green from 13 to 17; red is left only from 17 to 20
Tom now works 13-22. Only 17-20 is still short.

Dragging the middle of a bar moves it; dragging across an empty row adds a shift.

Step 4: type the times

Kenji, a part-timer, has the day off. The manager types 17-20 into his cell. The list offers Use these times, and Enter makes a Middle shift from 17:00 to 20:00, because timeCode('MD') says so. The break is worked out from the length.

The roster with Kenji Mori's cell on the 2nd selected and 17-20 typed into it; the list under it offers 17-20 Use these times 17:00-20:00, and Clear
Typing times instead of a code. Codes, times and two shifts like OP+CL all go in the same cell.
The timeline of Mon, Nov 2 after the change: Kenji Mori has a bar from 17 to 20 and the evening is no longer red
Monday is covered.
Open the day, drag a bar, type the times.

Step 5: the rules answer at once

Covering Monday had a price. Kenji's week now has red corners: hover over one, and it says why. With Monday filled, he works 10 days in a row, and the café's rule is 5.

The roster with red corners on Kenji Mori's cells from the 3rd to the 7th, and a tooltip: Kenji Mori, Sat, Nov 7, CL Closing 16:00-22:00, 10 days in a row (max 5)
The rule is checked while typing, not at the end of the month. Undo is one key away.

This is the point of the roster: the manager sees the cost of a change at the moment of making it, and can give the evening to someone else instead. A rule is an error by default: red, and auto-fill never breaks it. With ->warn() it is a warning: amber, and auto-fill avoids it when it can. Rest between shifts and contract hours are checked the same way.

Other scenes

  • Auto-fill a month from the shift codes, the needed numbers and each person's availability.
  • Publish the roster: staff see their shifts in My shifts and in their phone's calendar.
  • Open shifts: post the gaps, and the first part-timer who taps "I can work it" gets the shift.
  • Labour cost and budget: the cost row under the roster, against the month's budget.
  • Hospitals and care homes: night shifts, "after night" days and fair weekends work the same way.

Limits worth knowing

  • Up to two shifts per person per day (twoShiftsPerDay()); three or more are not supported.
  • Numbers that come from requirements() cannot be changed on the roster: change your data instead.
  • Auto-fill uses the shift codes' own times; it does not invent shorter times. Type or drag those.
  • The budget, labour cost and whole-team rules count one roster (one shop) at a time.

Try it

Open the café roster demo, click a day with red in the bottom rows, and drag a bar or type 17-20 into a day off. No sign-up, and the data is reset every hour.

More from the blog

See who is free next week and book them, in Filament

An agency manager needs 40 hours for a project that starts Monday. The planner shows only the people who have the time, the booking is a drag, and the overbooked project manager gets a fix in two clicks.

Laravel Rust vs Laravel Go vs Laravel PHP: The Complete Real-World Benchmark Guide

We benchmarked Laravel Rust, Laravel Go v0.1.0, and Laravel PHP (FPM, FrankenPHP, Swoole, Workerman) across 8 real workloads on the exact same machine — from 1,000-user spikes and heavy ORM to 100k-row deep pagination. Continuously updated as new tests land.

Work through support tickets without leaving the list, in Filament

A support agent opens a ticket, assigns it, sets it to pending and moves on to the next one with the arrow key. The list stays on the left; the View and Edit pages you already have open on the right.

Filament + AI coding tips, by email

How to fit Warp plugins into your own app and pair them with Claude Code or Cursor: prompts that work, mistakes AI makes, real examples. Once or twice a month. Unsubscribe anytime.

Ask us anything about Warp

No email address or sign-up needed.

We read every question and answer here on the site, usually within a day. Others see your question after we have checked it.

What's stopping you from using Warp's plugins?

One question. We read every answer, and it decides what we build next. It is not shown on the site.

What's stopping you from using Warp's plugins?