Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Console\Commands;
- use Illuminate\Console\Command;
- use App\Jobs\CheckPayment;
- use App\PaymentConfirmation;
- class CheckPaymentConfirmation extends Command
- {
- /**
- * The name and signature of the console command.
- *
- * @var string
- */
- protected $signature = 'payment:confirmation';
- /**
- * The console command description.
- *
- * @var string
- */
- protected $description = 'Check if the user is paying or not on 2 hours after booking.';
- /**
- * Create a new command instance.
- *
- * @return void
- */
- public function __construct()
- {
- parent::__construct();
- }
- /**
- * Execute the console command.
- *
- * @return mixed
- */
- public function handle()
- {
- $payments = PaymentConfirmation::where('status', PaymentConfirmation::UNCONFIRMED)->get();
- foreach ($payments as $payment) {
- dispatch(new CheckPayment($payment));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement