Getting started
Installation
Thank you for purchasing the Pulse plugin for Filament!
We tried to make the plugin as easy-to-install and versatile as possible. Nevertheless, if you still have a question or a feature request, please send an e-mail to [email protected].
Prerequisites
For these installation instructions to work, you'll need to have a Filament Panel installed and configured, as the Pulse plugin will add a new page to your panel.
Before starting the further installation, you should already have Laravel Pulse installed according to the Pulse installation guide.
The package is compatible with Filament V3, V4 and V5; and Laravel 10 or higher (with earlier versions available since Laravel 8).
Installation
Add Composer repository
Run the following command to add the private Composer repository:
composer config 'repositories.ralphjsmit/*' composer https://satis.ralphjsmit.com
The end result should look something like this:
"repositories": [
{
"type": "composer",
"url": "https://satis.ralphjsmit.com"
}
]
Require the package
Next, run the following command to require the package:
composer require ralphjsmit/laravel-filament-pulse
If you receive a question to allow the plugin to run code, select yes. Next, you will be prompted for your username (which is your e-mail) and your password (which is your license key, e.g. 8c21df8f-6273-4932-b4ba-8bcc723ef500).
If you are installing the package in a Filament V3 installation, you should require the version ^1.0 instead:
composer require ralphjsmit/laravel-filament-pulse:^1.0
Composer will ask if you want to store your credentials in your global auth.json.
If you want to store the credentials per project and not globally, run the following command to create an auth.json file in the root of your project instead:
composer config http-basic.satis.ralphjsmit.com {your_username} {your_password}
(Make sure not to commit the auth.json file by adding it to your .gitignore file.)
Add to custom theme
For all panels that you want to use the package in, make sure that you have created a Filament custom theme. Next, for each theme you need to add the following two lines to the theme.css file:
@source '../../../../vendor/ralphjsmit/laravel-filament-pulse/resources/**/*.blade.php';
@source '../../../../vendor/laravel/pulse/resources/**/*.blade.php';
Register the plugin
Next, you should register the plugin in each of the Filament panels that you are using and want to display the Pulse page in:
use RalphJSmit\Filament\Pulse\FilamentPulse;
$panel
->plugin(FilamentPulse::make())
Add Filament Usage Recorder
If you want to track the usage of your Filament panels, you should add the custom recorder to the config/pulse.php file under the recorders key.
This recorder will track frequently visited pages in your Filament panel. The recorder has been optimized with the optimization techniques provided by Pulse, so it will have no impact on the performance of your application.
\RalphJSmit\Filament\Pulse\Recorders\FilamentPageRecorder::class => [
'enabled' => env('PULSE_FILAMENT_PAGES_ENABLED', true),
'sample_rate' => env('PULSE_FILAMENT_PAGES_SAMPLE_RATE', 1),
'ignore' => [
// Panel IDs that you want to ignore. Should be a valid regex...
'#^admin#',
],
],
Make sure to register the plugin for each panel that you want to record the usage of. See the Configuring the plugin per-panel section for more information.
Configuring the plugin per-panel
In the rest of the docs, if we refer to the $plugin variable, then we mean the $plugin = FilamentPulse::make(). This is not necessarily a variable, but it helps to keep the code examples shorter and simpler.
Therefore, the following code examples mean the same:
$plugin
->serverCard(false)
->someOtherMethod();
use RalphJSmit\Filament\Pulse\FilamentPulse;
$panel
->plugin(
FilamentPulse::make()
->serverCard(enabled: false)
->someOtherMethod()
)
Filament Usage Recorder
If you registered the custom Filament Usage Recorder, you will need to add the ->plugin(FilamentPulse::make()) for every panel that you want to record the use of. However, by default, that will also register and display a Pulse page in every panel. If you want to monitor certain panels (like a user-facing panel), but only have the Pulse page in your admin panel, then you can disable the Pulse page on a per-panel basis.
If you want to disable the Pulse page in a panel, pass false to the ->pulsePage() method:
$plugin
->pulsePage(false);
Deployment environments
If you want to install Pulse during your GitHub Actions workflow, you can add the following line to your workflow file just before the composer install command:
composer config http-basic.satis.ralphjsmit.com ${{ secrets.FILAMENT_PULSE_USERNAME }} ${{ secrets.FILAMENT_PULSE_PASSWORD }}
composer install --no-interaction --prefer-dist --no-dev
Next, add the following two GitHub Actions secrets to your repository (Settings > Secrets and variables > Actions > New repository secret):
| Secret | Value |
|---|---|
| FILAMENT_PULSE_USERNAME | Your e-mail |
| FILAMENT_PULSE_PASSWORD | Your license key |
As Laravel Cloud does not support a global auth.json or a UI-based way to add private package credentials, the current solution is to add the following line to your deployment script, replacing {username} and {password} with your actual credentials:
composer config http-basic.satis.ralphjsmit.com {username} {password}
composer install --no-dev
Installing on Laravel Forge can be done in two ways. The simplest way is on first deploy to SSH to your server, run composer install, enter the required credentials and select yes when asked to save them in the global auth.json file. The other option is to go to {server} > PHP > Composer > Add credential in Forge. Here, enter the following details:
- Repository:
satis.ralphjsmit.com(note: do not prefix with https://) - Username: which is your e-mail
- Password: which is your license key
Publishing translations
If wanted, you can publish the translations using the following command:
php artisan vendor:publish --tag="filament-pulse-translations"
Changing the email associated with your license key
If you need to change the email associated with your license key, please send an e-mail to [email protected].
Changelog
You can view the changelog and/or subscribe for email updates on the Filament Plugins page. You can sign in using your license e-mail and a magic link, after which you can go to your plugin, click on the Gear icon > Changelog.