1. Go to this page and download the library: Download exolnet/laravel-heartbeat 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/ */
namespace App\Heartbeats;
class CustomChannel
{
/**
* Send a heartbeat signal.
*
* @param string $someOption
* @param array $moreOptions
* @return void
*/
public function signal($someOption, array $moreOptions = [])
{
// Send the signal according to the specified options.
}
}
namespace App\Providers;
use App\Heartbeats\CustomChannel;
use Heartbeat;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* @return void
*/
public function boot()
{
Heartbeat::extend('custom', function($app) {
return $app->make(CustomChannel::class);
});
}
}