invoice_enabled = $invoice_settings->enabled; $this->invoice_settings = $invoice_settings; } /** * Handle the event. * * @param \App\Events\PaymentEvent $event * @return void */ public function handle(PaymentEvent $event) { if ($this->invoice_enabled) { // create invoice using the trait $this->createInvoice($event->payment, $event->shopProduct, $this->invoice_settings); } } }