1. Go to this page and download the library: Download elpandape/filament-bouncer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
elpandape / filament-bouncer example snippets
use ElPandaPe\FilamentBouncer\Filament\FilamentBouncerPlugin;
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugin(FilamentBouncerPlugin::make());
}
$changes = [];
Event::listen(AbilityStanceChangedEvent::class, function (AbilityStanceChangedEvent $event) use (&$changes): void {
$changes[] = $event;
});
Event::listen(AbilityStancesSavedEvent::class, function (AbilityStancesSavedEvent $event) use (&$changes): void {
// every cell of this save has already been heard
record($event->authority, $changes);
$changes = [];
});