mix phx_filament.install (PhoenixFilament v0.1.0)

Copy Markdown View Source

Installs PhoenixFilament admin panel in your Phoenix app.

Usage

mix phx_filament.install

What it does

  1. Creates an admin Panel module at lib/{app_web}/admin.ex
  2. Copies Chart.js vendor asset to assets/vendor/chart.min.js
  3. Creates assets/js/phx_filament_hooks.js with Chart.js LiveView hook
  4. Patches router.ex to import PhoenixFilament.Panel.Router and mount the panel
  5. Patches assets/js/app.js to import phx_filament_hooks.js

Running this task multiple times is safe — it is idempotent.

Router patching

The installer attempts to automatically patch router.ex. If it cannot find the router or the browser scope, it will print clear instructions for manual steps.

JS patching

The installer attempts to automatically patch assets/js/app.js. If it cannot find the file, it will print clear instructions for manual steps.