Requirements
Filament has a few requirements to run:- PHP 8.0+
- Laravel v8.0+
- Livewire v2.0+
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:- Alpine.js
- Alpine.js Focus Plugin
- PostCSS
- Tailwind CSS
- Tailwind CSS Forms plugin
- Tailwind CSS Typography plugin
Configuring Tailwind CSS
To finish installing Tailwind, you must create a newtailwind.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:
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:postcss.config.js file in the root of your project, and register Tailwind CSS and Autoprefixer as plugins:
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 usingnpm run dev.
Configuring layout
Finally, create a newresources/views/layouts/app.blade.php layout file for Livewire components:
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:Upgrading
To upgrade the package to the latest version, you must run:filament:upgrade command to your composer.json’s post-update-cmd to run it automatically: