# Filament Gantt

![Filament Gantt](https://raw.githubusercontent.com/packstub/art/main/filament-gantt/banner.jpg)

A Gantt chart and resource timeline for Filament v4 (4.13+) and v5. Any Eloquent query with a start and an end becomes draggable bars on an hour, day, week, month or year axis, grouped by whatever you like; the browser owns the chart, so a drag lands at once, and the server checks every rule again in the background. Free and open source (MIT). The sibling of [Filament Kanban](https://packstub.dev/docs/filament-kanban).

- Repository: [github.com/packstub/filament-gantt](https://github.com/packstub/filament-gantt)
- Packagist: [packstub/filament-gantt](https://packagist.org/packages/packstub/filament-gantt)
- Support: [GitHub issues](https://github.com/packstub/filament-gantt/issues)

## Features

- **[Drag to move, resize or reassign](https://packstub.dev/docs/filament-gantt/moves)**: bars move at once, by an edge or to another row.
- **[Rules on the server](https://packstub.dev/docs/filament-gantt/moves)**: policies, durations and a locked past, always checked.
- **[Groups and resource timelines](https://packstub.dev/docs/filament-gantt/groups)**: rows by project, assignee, room or machine.
- **[Milestones, progress and dependencies](https://packstub.dev/docs/filament-gantt/bars)**: diamonds, fills and finish-to-start arrows.
- **[Filament actions on bars](https://packstub.dev/docs/filament-gantt/actions)**: click to edit, right-click for more, click to create.
- **[Hour to year, zoom and Fit](https://packstub.dev/docs/filament-gantt/filters)**: five scales, wheel or pinch zoom, the whole plan in one screen.
- **[Search and filters](https://packstub.dev/docs/filament-gantt/filters)**: Filament's filter fields, kept in the URL.
- **[Keyboard and touch](https://packstub.dev/docs/filament-gantt/moves)**: move and resize with the arrows, drag on touch.
- **[Resource page, standalone page or widget](https://packstub.dev/docs/filament-gantt/widget)**: wherever your panel needs a timeline.
- **[No Gantt library, no build step](https://packstub.dev/docs/filament-gantt/styling)**: dark mode, RTL and four languages.

## Guides

| Guide | What it covers |
| --- | --- |
| [Installation](https://packstub.dev/docs/filament-gantt/installation) | Requirements, your first chart on a resource page, a chart in any Livewire component |
| [Bars](https://packstub.dev/docs/filament-gantt/bars) | Start and end attributes, whole days versus moments, label, colour, progress, milestones, the `Bar` shape |
| [Groups](https://packstub.dev/docs/filament-gantt/groups) | Grouping by a column or a relation, fixed group lists, the resource-timeline recipe (rooms × bookings) |
| [Moving and resizing](https://packstub.dev/docs/filament-gantt/moves) | What a drag does, snapping, every rule, `moveUsing()`, `afterMove()`, the `BarMoved` event |
| [Filters and the time window](https://packstub.dev/docs/filament-gantt/filters) | Scales, the window and its bounds, the search box, select, multiple, Yes / No, toggle and date-range filters and where they are shown, refreshing and polling |
| [Actions](https://packstub.dev/docs/filament-gantt/actions) | Click and right-click actions on bars, creating on an empty spot |
| [Widget and read-only mode](https://packstub.dev/docs/filament-gantt/widget) | The dashboard widget, `readOnly()` |
| [Styling](https://packstub.dev/docs/filament-gantt/styling) | The CSS variables, dark mode, RTL, translations |
| [Performance](https://packstub.dev/docs/filament-gantt/performance) | What is drawn where, row windowing, eager loading, big windows |
| [Kanban + Gantt](https://packstub.dev/docs/filament-gantt/kanban) | The same records on a board and on a timeline |
| [Upgrading](https://packstub.dev/docs/filament-gantt/upgrading) | Version notes |

## At a glance

```bash
composer require packstub/filament-gantt
php artisan filament:assets
```

```php
use Filament\Actions\EditAction;
use Packstub\Gantt\Gantt;
use Packstub\Gantt\Pages\GanttResourcePage;

class TasksGantt extends GanttResourcePage
{
    protected static string $resource = TaskResource::class;

    public function gantt(Gantt $gantt): Gantt
    {
        return $gantt
            ->query(fn () => Task::query()->with('project'))
            ->start('starts_on')->end('ends_on')
            ->label('title')
            ->progress('progress')
            ->groupBy('project', label: 'project.name')
            ->barAction(EditAction::make()->schema(TaskResource::fields()));
    }
}
```

(`TaskResource::fields()` is your own helper returning the form components; `->schema(fn (Schema $schema) => TaskResource::form($schema))` reuses the resource's form.)

## Requirements

PHP 8.3+, Laravel 12 or 13, Filament 4.13+ or 5.

---

These pages are published at [packstub.dev/docs/filament-gantt](https://packstub.dev/docs/filament-gantt) from the package's `docs/` directory. Spotted a mistake? [Open a pull request](https://github.com/packstub/filament-gantt).
