# `mix phx_filament.install`
[🔗](https://github.com/franciscpd/phoenix-filament/blob/main/lib/mix/tasks/phx_filament.install.ex#L1)

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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
