diff --git a/app/Observers/CompanyGatewayObserver.php b/app/Observers/CompanyGatewayObserver.php new file mode 100644 index 0000000000..41fc6c03a5 --- /dev/null +++ b/app/Observers/CompanyGatewayObserver.php @@ -0,0 +1,66 @@ +label){ + $company_gateway->label = $company_gateway->gateway->name; + $company_gateway->save(); + } + } + + /** + * Handle the company gateway "updated" event. + * + * @param \App\CompanyGateway $company_gateway + * @return void + */ + public function updated(CompanyGateway $company_gateway) + { + // + } + + /** + * Handle the company gateway "deleted" event. + * + * @param \App\CompanyGateway $company_gateway + * @return void + */ + public function deleted(CompanyGateway $company_gateway) + { + // + } + + /** + * Handle the company gateway "restored" event. + * + * @param \App\CompanyGateway $company_gateway + * @return void + */ + public function restored(CompanyGateway $company_gateway) + { + // + } + + /** + * Handle the company gateway "force deleted" event. + * + * @param \App\CompanyGateway $company_gateway + * @return void + */ + public function forceDeleted(CompanyGateway $company_gateway) + { + // + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 154cb4b455..3f024e70fb 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -15,6 +15,7 @@ use App\Helpers\Language\DecoratedTranslator; use App\Models\Account; use App\Models\Client; use App\Models\Company; +use App\Models\CompanyGateway; use App\Models\CompanyToken; use App\Models\Expense; use App\Models\Invoice; @@ -26,6 +27,7 @@ use App\Models\Task; use App\Models\User; use App\Observers\AccountObserver; use App\Observers\ClientObserver; +use App\Observers\CompanyGatewayObserver; use App\Observers\CompanyObserver; use App\Observers\CompanyTokenObserver; use App\Observers\ExpenseObserver; @@ -68,6 +70,7 @@ class AppServiceProvider extends ServiceProvider Account::observe(AccountObserver::class); Client::observe(ClientObserver::class); Company::observe(CompanyObserver::class); + CompanyGateway::observe(CompanyGatewayObserver::class); CompanyToken::observe(CompanyTokenObserver::class); Expense::observe(ExpenseObserver::class); Invoice::observe(InvoiceObserver::class);