Created
January 4, 2021 18:03
-
-
Save jongravois/7f6f9ad663eff3519103dda48bb2b9e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Jobs; | |
use App\Models\ConsignmentBand; | |
use App\Models\PostedInvoice; | |
use App\Models\Project; | |
use App\Pipes\Invoices\BandedRatesProfit; | |
use App\Pipes\Invoices\FixedRateProfit; | |
use App\Pipes\Invoices\NoConsignmentAbort; | |
use Illuminate\Bus\Queueable; | |
use Illuminate\Contracts\Queue\ShouldQueue; | |
use Illuminate\Foundation\Bus\Dispatchable; | |
use Illuminate\Pipeline\Pipeline; | |
use Illuminate\Queue\InteractsWithQueue; | |
use Illuminate\Queue\SerializesModels; | |
class ProcessInvoiceJob implements ShouldQueue | |
{ | |
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; | |
public $invoice; | |
public function __construct(PostedInvoice $invoice) | |
{ | |
$this->invoice = $invoice; | |
} | |
public function handle() | |
{ | |
app(Pipeline::class) | |
->send($this->invoice) | |
->through([ | |
NoConsignmentAbort::class, | |
FixedRateProfit::class, | |
BandedRatesProfit::class | |
]) | |
->thenReturn(); | |
} // end function | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment