Skip to content

Instantly share code, notes, and snippets.

@futzlarson
Last active March 26, 2026 23:48
Show Gist options
  • Select an option

  • Save futzlarson/009bcd9a81a383265f38b24d219dc241 to your computer and use it in GitHub Desktop.

Select an option

Save futzlarson/009bcd9a81a383265f38b24d219dc241 to your computer and use it in GitHub Desktop.
Care Management: Missing php artisan filament:assets in Vapor build

Missing php artisan filament:assets in Vapor Build

The Problem

Filament ships two separate layers that must stay in sync:

  • PHP — blade templates, component classes, action definitions (updated via composer update)
  • JS — compiled Alpine components published to public/js/filament/ (updated via php artisan filament:assets)

The Vapor build steps run composer install (which pulls the latest PHP), but never run php artisan filament:assets. This means every Filament version bump via composer silently leaves the published JS behind.

How It Was Discovered

Escape key was broken on all modals. The blade template referenced isTopmost() (added in v4.7.2) but the published support.js was from v4.3.1 and didn't include it. Diffing the two JS files confirmed isTopmost was the only user-facing gap across five minor releases — the rest were internal DOM morphing utilities.

The Fix

Add php artisan filament:assets to the build steps in vapor.yml, before npm run build:

build:
    - 'composer install --no-dev --optimize-autoloader'
    - 'php artisan optimize'
    - 'php artisan event:cache'
    - 'php artisan icons:cache'
    - 'php artisan filament:cache-components'
    - 'php artisan filament:assets'   # ← add this
    - 'npm ci && npm run build && rm -rf node_modules'

This ensures the published JS always matches the installed PHP version on every deploy.

Local Fix

Run php artisan filament:assets locally after any composer update that bumps Filament, and commit the updated public/js/filament/ files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment