1. Go to this page and download the library: Download elazaroo/pulse-boosted 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/ */
elazaroo / pulse-boosted example snippets
use App\Models\User;
use Illuminate\Support\Facades\Gate;
Gate::define('viewPulseBoosted', function (User $user) {
return $user->isAdministrator();
});
Gate::define('managePulseBoostedQueues', function (User $user) {
return $user->isAdministrator();
});
use Elazaroo\PulseBoosted\Events\AlertResolved;
use Elazaroo\PulseBoosted\Events\AlertTriggered;
Event::listen(function (AlertTriggered $event) {
Notification::route('slack', config('alerting.slack'))
->notify(new SomethingIsWrong($event->rule->name, $event->value));
});
Event::listen(function (AlertResolved $event) {
// Worth sending too: an alert nobody is told has ended is an alert
// somebody is still worrying about.
});