Warp

Dispatch field technicians from a Filament schedule board

5 min read

It is eight in the morning at a repair company. Overnight, fourteen jobs came in: a blocked drain, a fuse box, a dishwasher that will not drain. Four technicians are on the road today, each with their own skill and some jobs already booked. The dispatcher has to put each new job on someone's day, without giving anyone two jobs at once.

In a plain Filament panel this is a form per job: open it, pick a technician, type a start time, save, then check another list to see whether that technician was already busy at that time. With fourteen jobs, the dispatcher keeps a paper timeline on the side.

This article shows the dispatch page of the Warp Scheduler demo: a day timeline with one row per technician, the waiting jobs in an ordinary Filament table next to it, and assigning a job by dragging it onto a row. All pictures are from the live demo.

The scene: the board and the waiting jobs

On the left, the field team's day, from 08:00 to 18:00, with a row per technician and their skill under the name. On the right, the jobs waiting for a technician, with priority and length.

A day timeline with rows for Aiko Tanaka (Electrical), Ben Carter (Plumbing), Chloe Martin (HVAC) and Diego Ruiz (Appliances), and a table titled Waiting for a technician listing jobs with Urgent or Normal priority and a length in hours
Today's board and the jobs no one has yet. Urgent jobs are red.

Step 1: a scheduler with a row per technician

The board is a Filament widget that uses Warp Scheduler. The rows are your Technician records, the boxes are your WorkOrder records, and NoOverlap keeps one job per technician at a time.

use Qalainau\FilamentWarpScheduler\Conflicts\NoOverlap;
use Qalainau\FilamentWarpScheduler\Enums\SchedulerView;
use Qalainau\FilamentWarpScheduler\Enums\TimelineZoom;
use Qalainau\FilamentWarpScheduler\EventSource;
use Qalainau\FilamentWarpScheduler\Scheduler;

public function scheduler(Scheduler $scheduler): Scheduler
{
    return $scheduler
        ->resources(fn () => Technician::query()->where('team', 'Field')->orderBy('name'))
        ->resourceLabel('Technician')
        ->resourceDescription('skill')
        ->views([SchedulerView::ResourceTimeline])
        ->timelineZooms([TimelineZoom::Day, TimelineZoom::Week])
        ->visibleHours('08:00', '18:00')
        ->conflictRules([NoOverlap::make()])
        ->onExternalDrop(fn (array $data, CarbonImmutable $start, ?Technician $resource): ?WorkOrder =>
            $this->assignWaitingWorkOrder($data, $start, $resource))
        ->events([
            EventSource::make(WorkOrder::class)
                ->resource('technician_id')->start('starts_at')->end('ends_at')
                ->title('title')->subtitle('customer')
                ->color(fn (WorkOrder $record): string => $record->priority === 'urgent' ? 'danger' : 'primary'),
        ]);
}

Step 2: make the table rows draggable

The waiting jobs are a normal Filament table widget. Filament 5 tables have no row attributes, so the title column carries the attributes the scheduler looks for, and that cell becomes the handle to drag:

TextColumn::make('title')
    ->description(fn (WorkOrder $record): string => $record->customer)
    ->extraAttributes(fn (WorkOrder $record): array => [
        'draggable' => 'true',
        'data-warp-scheduler-draggable' => e(json_encode(['id' => $record->id])),
        'data-warp-scheduler-title' => $record->title,
        'data-warp-scheduler-duration' => $record->duration_minutes,
        'data-warp-scheduler-color' => $record->priority === 'urgent' ? 'danger' : 'primary',
    ]),

Wrap the JSON in e(). Filament does not escape attribute values, and an unescaped quote ends the attribute, so the drop would silently do nothing. duration gives the dragged box its length.

Step 3: drag a job onto a technician

The dispatcher grabs "Blocked drain" by its title and drags it onto Diego's row. While dragging, the board shows where it will land and the exact time.

Mid-drag: the job Blocked drain from Batz Ltd hovers over Diego Ruiz's row at 10:30, with a preview labeled Nov 19, 10:30 – 11:30
The preview snaps to 15 minutes and shows the time before you let go.
From the table to Diego's morning in one drag.

On drop, onExternalDrop() gets the id from the attribute, the start time under the mouse, and the technician of the row. Your callback books the job:

protected function assignWaitingWorkOrder(array $data, CarbonImmutable $start, ?Technician $resource): ?WorkOrder
{
    // $data comes from the browser: look it up in a scoped query, never fill() with it
    $workOrder = WorkOrder::query()->unscheduled()->find($data['id'] ?? null);

    if (! $workOrder || ! $resource) {
        return null;
    }

    $workOrder->update([
        'technician_id' => $resource->getKey(),
        'starts_at' => $start,
        'ends_at' => $start->addMinutes($workOrder->duration_minutes),
    ]);

    return $workOrder;
}

Return the record, and the board draws it at once. In the demo, the page also refreshes the table with the browser event the scheduler fires after a drop, so the job leaves the waiting list.

The Blocked drain job is now on Diego Ruiz's row from 10:30 to 11:30 and no longer in the waiting table
Booked on Diego from 10:30 to 11:30, and gone from the waiting list.

Step 4: the board says no to a double booking

Then the dispatcher has second thoughts: it is a drain, so the plumber should go. They drag the job up to Ben Carter, who already has a job from 09:00 to 12:00. Before they let go, the board shows a red band: "Overlaps another event".

The job is dragged over Ben Carter's row where he already has Leaking tap; a red label reads Nov 19, 10:30 – 11:30 · Overlaps another event
NoOverlap is checked while dragging. Dropped here, the job goes back to Diego with a message.

The rules run again on the server when the change is saved, so a stale browser cannot get around them. Other rules work the same way:

->conflictRules([
    NoOverlap::make()->capacity('capacity'),   // some people can take two jobs at once
    WithinAvailability::make()->warn(),        // outside working hours: warn, do not refuse
    NoBlockedTime::make(),                     // holidays and blocked time
])

Throw ChangeRejected from your own code to refuse with your own message ("Chloe is not certified for gas").

Step 5: a job that runs long

Chloe is free from 10:00, so the job goes to her. The customer calls: it is worse than it sounded. The dispatcher drags the right edge of the box half an hour further.

The Blocked drain job on Chloe Martin's row, stretched to 10:30–12:00
Now 10:30–12:00 on Chloe's row. Stretching into another job would be refused too.

"Week overview" switches the same board to the week, which is where the dispatcher sees who is already full on Friday.

Other scenes

  • Deliveries: orders onto vans or drivers.
  • Lessons: requests onto teachers' rows.
  • Care visits and interpreters: visits onto staff, with WithinAvailability for their hours.
  • Workshops: jobs onto machines or bays. Two boards on one page can hand jobs to each other with onAdopt().

Limits worth knowing

  • A job dropped where there is no row (no technician) gets $resource = null. Decide in your callback what that means. The demo ignores it.
  • Rules are checked before the save's transaction. If two dispatchers drop onto the same slot within the same fraction of a second, both checks can pass. The README shows how to check again with a lock inside your callback.
  • $data comes from the browser. Treat it like request input: a query scoped to the user and the tenant, and your policy.
  • No table to drag from? unscheduledPool() lists the jobs with no start time next to the board, each with a button that books it into the first free slot.

Try it

Open the dispatch board. Drag a waiting job by its title onto a technician, then try to drag it onto someone who is busy. No sign-up, and the data is reset every hour.

More from the blog

Import a messy customer CSV into Filament, and fix it before anything is saved

Moving off an old system? Its export has the wrong column names, a broken email, a missing name and the same customer twice. Match the columns, see every problem, fix the cells, then import.

Stop duplicate customers in a Filament form before they are saved

The same customer added twice, once with capitals in the email and once with brackets in the phone number. Warn the person typing, show the existing customer, and keep your list clean.

Paste an Excel order into a Filament repeater

A customer sends 120 order lines in a spreadsheet. Let your team paste them straight into a Filament repeater, with products picked, totals recalculated and nothing retyped.

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?