Requirements
Filament has a few requirements to run:- PHP 8.0+
- Laravel v8.0+
- Livewire v2.0+
New Laravel projects
To get started with notifications 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 sending notifications!
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 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, add custom colors used by notifications:
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 have been updated:
Laravel Mix
In yourwebpack.mix.js file, register Tailwind CSS as a PostCSS plugin:
Configuring styles
In/resources/css/app.css, import Tailwind CSS:
Configuring scripts
In/resources/js/app.js, import Alpine.js, Alpine Floating UI and the filament/notifications plugin, 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: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: