renamed income/expense
This commit is contained in:
36
app/Jobs/Sale/DuplicateInvoice.php
Normal file
36
app/Jobs/Sale/DuplicateInvoice.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Sale;
|
||||
|
||||
use App\Abstracts\Job;
|
||||
use App\Events\Sale\InvoiceCreated;
|
||||
use App\Models\Sale\Invoice;
|
||||
|
||||
class DuplicateInvoice extends Job
|
||||
{
|
||||
protected $invoice;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @param $invoice
|
||||
*/
|
||||
public function __construct($invoice)
|
||||
{
|
||||
$this->invoice = $invoice;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return Invoice
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$clone = $this->invoice->duplicate();
|
||||
|
||||
event(new InvoiceCreated($clone));
|
||||
|
||||
return $clone;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user