Skip to main content

Requirements

Filament has a few requirements to run:
  • PHP 8.0+
  • Laravel v8.0+
  • Livewire v2.0+
Notifications come 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 notifications package using Composer:

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! Filament 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 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, add custom colors used by notifications:
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 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 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 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 sending notifications!

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:
We recommend adding the filament:upgrade command to your composer.json’s post-update-cmd to run it automatically: