app/Console/Commands/ReleaseOldReservations.php
/**
     * Execute the console command.
     *
     * @return int
     */
Execute the console command.
@return int
Execute the console command . @return int
public function handle()
    {
        $count = Code::whereNull('purchased_at')
            ->where('reserved_at', '<', now()->subMinutes(10))
            ->update([
                'reserved_at'    => null,
                'reserved_by_id' => null,
            ]);
        $this->info('Expired coupon reservations has been released successfully.');
        $this->info('Reservations released: ' . $count);
    }
public function handle ( ) { $ count = Code :: whereNull ( 'purchased_at' ) -> where ( 'reserved_at' , '<' , now ( ) -> subMinutes ( 10 ) ) -> update ( [ 'reserved_at' => null , 'reserved_by_id' => null , ] ) ; $ this -> info ( 'Expired coupon reservations has been released successfully.' ) ; $ this -> info ( 'Reservations released: ' . $ count ) ; }
Execute the console command.
Execute the console command .