company->id) ->where('event_id', Webhook::EVENT_CREATE_CREDIT) ->exists(); if ($subscriptions) { WebhookHandler::dispatch(Webhook::EVENT_CREATE_CREDIT, $credit, $credit->company)->delay(now()->addSeconds(2)); } } /** * Handle the client "updated" event. * * @param Credit $credit * @return void */ public function updated(Credit $credit) { $subscriptions = Webhook::where('company_id', $credit->company->id) ->where('event_id', Webhook::EVENT_UPDATE_CREDIT) ->exists(); if ($subscriptions) { WebhookHandler::dispatch(Webhook::EVENT_UPDATE_CREDIT, $credit, $credit->company)->delay(now()->addSeconds(2)); } } /** * Handle the client "deleted" event. * * @param Credit $credit * @return void */ public function deleted(Credit $credit) { $subscriptions = Webhook::where('company_id', $credit->company->id) ->where('event_id', Webhook::EVENT_DELETE_CREDIT) ->exists(); if ($subscriptions) { WebhookHandler::dispatch(Webhook::EVENT_DELETE_CREDIT, $credit, $credit->company)->delay(now()->addSeconds(2)); } } /** * Handle the client "restored" event. * * @param Credit $credit * @return void */ public function restored(Credit $credit) { // } /** * Handle the client "force deleted" event. * * @param Credit $credit * @return void */ public function forceDeleted(Credit $credit) { // } }