Warp

Mark defects on site photos in a Filament form

4 min read

A site inspector walks a flat before handover. In the living room there is a crack running from the corner of the window, and the socket cover below it is loose. They take a photo. Then, back at the office, someone has to explain which crack, where exactly, and what to do about it. Usually that means the photo in one place, a description in another field ("crack, lower right of the window, about 40 cm"), and a screenshot with a red circle made in some other app and emailed around.

This article shows the same form with Warp Markup: the inspector uploads the photo and draws on it in the same form, with a circle, an arrow and a numbered pin with a note. The marks are saved with the record. All pictures are from the live demo.

The scene: one photo, two problems

The inspector opens "New site photo", types what is in the photo and uploads it. Right under the upload field, the same photo appears as a drawing area, with a small toolbar: select, pin, circle, arrow, seven colors, undo, redo and delete.

A photo of a wall with a window; a red circle is drawn around a crack below the window corner and a red arrow points at a socket cover; a toolbar with pin, circle, arrow and color buttons is above the photo
A circle around the crack and an arrow at the socket cover, drawn with the mouse (or a finger on a tablet).

Step 1: a drawing field next to the upload

The photo is a normal Filament FileUpload. MarkupField draws on the first image of that upload with imageFrom(), and tools() keeps the toolbar to what an inspector needs.

use Filament\Forms\Components\FileUpload;
use Qalainau\FilamentWarpMarkup\Forms\MarkupField;

FileUpload::make('photo')
    ->image()
    ->disk('public')
    ->maxSize(5120),

MarkupField::make('photo_marks')
    ->imageFrom('photo')
    ->tools(['arrow', 'ellipse', 'pin']),

The marks are saved in one JSON column, so the model only needs a cast:

protected function casts(): array
{
    return ['photo_marks' => 'array'];
}

The photo file itself is never changed. Replace the photo with a better one, and the marks stay where they were, because they are stored in the image's own pixels.

Step 2: draw while the photo is fresh

Circles and arrows are dragged. A pin is a click: it gets a number and a small note field, and the note is also listed under the photo.

Circle, arrow, pin and note, in about ten seconds.
The same photo with a numbered pin 1 on the crack, and under the photo the note: Crack from the window corner. Fill and repaint before handover.
Pin 1 and its note. More pins get 2, 3 and so on, in the order they were placed.

The server checks the shape of what is saved. Unknown kinds of marks and broken coordinates are dropped, because the JSON comes from the browser.

Step 3: the office gets one picture

After saving, the view page shows the marks on the photo, read-only, with MarkupEntry. For a printed report or an email, the marks need to be inside the picture. MarkupImage draws them into a copy of the photo on the server, with PHP's GD, and lists the pin notes under it:

use Qalainau\FilamentWarpMarkup\MarkupImage;

$jpeg = MarkupImage::fromDisk('public', $record->photo, $record->photo_marks, [
    'maxWidth' => 1200,
    'notes' => true,
]);
A single picture made on the server: the photo with the circle, the arrow and pin 1 drawn into it, and the note listed under it
One JPEG with the marks and the notes. The demo offers it as "Download picture with marks".

MarkupImage::dataUri() gives the same picture as a data: URI, for an <img> in a Blade view or an email.

The list of site photos shows how many marks each one has, so the office sees at a glance which photos have work on them.

A Filament table of site photos with a thumbnail, a title and a Marks column showing 3
The list of site photos. "Marks" counts the circle, the arrow and the pin.

Other scenes

  • Vehicle check-in: scratches and dents marked on a photo or a drawing of the car (the demo has one).
  • Move-out inspections: numbered pins on wall and floor damage, then one picture in the quote.
  • Maintenance reports: an arrow at the broken part, pasted into the report email.
  • Returns: a circle around the damaged corner of a product.

The toolbar has more tools when you need them: rectangles, clouds, lines, freehand ink, highlight, text and stamps. Pass the ones you want to tools().

For whole projects, Warp Markup also has a drawing workspace: PDF drawings with numbered findings as records of your own model, statuses, assignees, revisions and a findings report. The photo field in this article is the small end of it.

Limits worth knowing

  • MarkupImage needs PHP's gd extension. Phone photos are turned the right way up from their EXIF data when the exif extension is installed.
  • The bundled font for notes in the picture covers Latin, Greek and Cyrillic letters. For Japanese, Chinese or Korean notes, set a font that has them (MarkupImage::defaultFont() or the font option).
  • SVG images can be drawn on in the form, but MarkupImage cannot turn them into a picture.

Try it

Open the site photos demo and press "New site photo". Upload any photo from your phone or computer, draw a circle and a pin, save, and download the picture with the marks. 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?