ctrlpanel/app/Listeners/CreateInvoice.php

27 lines
503 B
PHP
Raw Normal View History

<?php
namespace App\Listeners;
use App\Events\PaymentEvent;
use App\Traits\Invoiceable;
class CreateInvoice
{
2023-02-06 20:16:54 +00:00
use Invoiceable;
2023-02-06 20:16:54 +00:00
/**
* Handle the event.
*
* @param \App\Events\PaymentEvent $event
* @return void
*/
public function handle(PaymentEvent $event)
{
if (config('SETTINGS::INVOICE:ENABLED') == 'true') {
// create invoice using the trait
$this->createInvoice($event->payment, $event->shopProduct);
}
}
}