Skip to main content

Requirements

Filament has a few requirements to run:
  • PHP 8.0+
  • Laravel v8.0+
  • Livewire v2.0+
The table builder comes pre-installed inside the admin panel 2.x, but you must still follow the installation instructions below if you’re using it in the rest of your app. First, require the table builder using Composer:

New Laravel projects

To get started with the table builder quickly, you can set up Livewire, Alpine.js and Tailwind CSS with these commands:
These commands will ruthlessly overwrite existing files in your application, hence why we only recommend using this method for new projects.
You’re now ready to start building tables!

Existing Laravel projects

The package uses the following dependencies: You may install these through NPM:

Configuring Tailwind CSS

To finish installing Tailwind, you must create a new tailwind.config.js file in the root of your project. The easiest way to do this is by running npx tailwindcss init. In tailwind.config.js, register the plugins you installed, and add custom colors used by the table builder:
Of course, you may specify your own custom primary, success, warning and danger colors, which will be used instead.

Bundling assets

New Laravel projects use Vite for bundling assets by default. However, your project may still use Laravel Mix. Read the steps below for the bundler used in your project.

Vite

If you’re using Vite, you should manually install Autoprefixer through NPM:
Create a postcss.config.js file in the root of your project, and register Tailwind CSS and Autoprefixer as plugins:
You may also want to update your vite.config.js file to refresh the page after Livewire components or custom table columns have been updated:

Laravel Mix

In your webpack.mix.js file, register Tailwind CSS as a PostCSS plugin:

Configuring styles

In /resources/css/app.css, import filament/forms vendor CSS and Tailwind CSS:

Configuring scripts

In /resources/js/app.js, import Alpine.js, @alpinejs/focus, the filament/forms and filament/notifications plugins, and register them:

Compiling assets

Compile your new CSS and JS assets using npm run dev.

Configuring layout

Finally, create a new resources/views/layouts/app.blade.php layout file for Livewire components:
You’re now ready to start building tables!

Publishing configuration

If you wish, you may publish the configuration of the package using:

Publishing translations

If you wish to translate the package, you may publish the language files using:
Since this package depends on other Filament packages, you may wish to translate those as well:

Upgrading

To upgrade the package to the latest version, you must run:
We recommend adding the filament:upgrade command to your composer.json’s post-update-cmd to run it automatically: