*/ class SendBeaconJobHandler { /** * The beacon instance. * * @var \CachetHQ\Cachet\Integrations\Contracts\Beacon */ protected $beacon; /** * Create a new send beacon job handler instance. * * @param \CachetHQ\Cachet\Integrations\Contracts\Beacon $beacon * * @return void */ public function __construct(Beacon $beacon) { $this->beacon = $beacon; } /** * Handle the send beacon job. * * @param \CachetHQ\Cachet\Bus\Jobs\SendBeaconJob $job * * @return void */ public function handle(SendBeaconJob $job) { // Don't send anything if the installation explicitly prevents us. if (!$this->beacon->enabled()) { return; } try { $this->beacon->send(); } catch (Exception $e) { // } } }