File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212
1313 strategy :
1414 matrix :
15- php : [8.3, 8.4]
15+ php : [8.3, 8.4, 8.5 ]
1616 laravel : [12.*]
1717 stability : [prefer-lowest, prefer-stable]
1818 os : [ubuntu-latest]
3737 - name : Run PHPUnit
3838 run : vendor/bin/pest
3939 env :
40- STRIPE_KEY : ${{ matrix.php == '8.4 ' && secrets.STRIPE_KEY || '' }}
41- STRIPE_SECRET : ${{ matrix.php == '8.4 ' && secrets.STRIPE_SECRET || '' }}
42- MOLLIE_KEY : ${{ matrix.php == '8.4 ' && secrets.MOLLIE_KEY || '' }}
43- MOLLIE_PROFILE : ${{ matrix.php == '8.4 ' && secrets.MOLLIE_PROFILE || '' }}
40+ STRIPE_KEY : ${{ matrix.php == '8.5 ' && secrets.STRIPE_KEY || '' }}
41+ STRIPE_SECRET : ${{ matrix.php == '8.5 ' && secrets.STRIPE_SECRET || '' }}
42+ MOLLIE_KEY : ${{ matrix.php == '8.5 ' && secrets.MOLLIE_KEY || '' }}
43+ MOLLIE_PROFILE : ${{ matrix.php == '8.5 ' && secrets.MOLLIE_PROFILE || '' }}
Original file line number Diff line number Diff line change 4343 },
4444 "require-dev" : {
4545 "laravel/pint" : " dev-main" ,
46- "orchestra/testbench" : " ^10.0" ,
47- "pestphp/pest" : " ^3.0" ,
48- "pestphp/pest-plugin-laravel" : " ^3.0" ,
49- "phpunit/phpunit" : " ^11.0" ,
46+ "orchestra/testbench" : " ^10.8" ,
47+ "pestphp/pest" : " ^3.0 || ^4.1.4" ,
48+ "pestphp/pest-plugin-laravel" : " ^3.0 || ^4.0" ,
5049 "spatie/ray" : " ^1.17" ,
5150 "spatie/test-time" : " ^1.3" ,
5251 "statamic-rad-pack/runway" : " ^9.0.0-alpha.5"
Original file line number Diff line number Diff line change 44
55use DuncanMcClean \SimpleCommerce \Facades \Order ;
66use DuncanMcClean \SimpleCommerce \Orders \OrderStatus ;
7+ use DuncanMcClean \SimpleCommerce \SimpleCommerce ;
78use Illuminate \Console \Command ;
89use Illuminate \Support \Carbon ;
910use Statamic \Console \RunsInPlease ;
@@ -20,9 +21,15 @@ public function handle()
2021 {
2122 $ this ->info ('Cleaning up.. ' );
2223
24+ $ fourteenDaysFromNow = Carbon::now ()->subDays (14 );
25+
26+ if ($ this ->isOrExtendsClass (SimpleCommerce::orderDriver ()['repository ' ], \DuncanMcClean \SimpleCommerce \Orders \EntryOrderRepository::class)) {
27+ $ fourteenDaysFromNow = $ fourteenDaysFromNow ->timestamp ;
28+ }
29+
2330 Order::query ()
2431 ->whereOrderStatus (OrderStatus::Cart)
25- ->where ('updated_at ' , '<= ' , Carbon:: now ()-> subDays ( 14 )-> timestamp )
32+ ->where ('updated_at ' , '<= ' , $ fourteenDaysFromNow )
2633 ->chunk (100 , function ($ orders ) {
2734 $ orders ->each (function ($ order ) {
2835 $ this ->line ("Deleting Order: {$ order ->id ()}" );
You can’t perform that action at this time.
0 commit comments