company->id) ->where('event_id', Webhook::EVENT_CREATE_EXPENSE) ->exists(); if ($subscriptions) { WebhookHandler::dispatch(Webhook::EVENT_CREATE_EXPENSE, $expense, $expense->company)->delay(now()->addSeconds(2)); } } /** * Handle the expense "updated" event. * * @param Expense $expense * @return void */ public function updated(Expense $expense) { $subscriptions = Webhook::where('company_id', $expense->company->id) ->where('event_id', Webhook::EVENT_UPDATE_EXPENSE) ->exists(); if ($subscriptions) { WebhookHandler::dispatch(Webhook::EVENT_UPDATE_EXPENSE, $expense, $expense->company)->delay(now()->addSeconds(2)); } } /** * Handle the expense "deleted" event. * * @param Expense $expense * @return void */ public function deleted(Expense $expense) { $subscriptions = Webhook::where('company_id', $expense->company->id) ->where('event_id', Webhook::EVENT_DELETE_EXPENSE) ->exists(); if ($subscriptions) { WebhookHandler::dispatch(Webhook::EVENT_DELETE_EXPENSE, $expense, $expense->company)->delay(now()->addSeconds(2)); } } /** * Handle the expense "restored" event. * * @param Expense $expense * @return void */ public function restored(Expense $expense) { // } /** * Handle the expense "force deleted" event. * * @param Expense $expense * @return void */ public function forceDeleted(Expense $expense) { // } /** * Handle the expense "archive" event. * * @param Expense $expense * @return void */ }