mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-23 01:32:15 +00:00
- scheduler command updates
- Order reminder notification
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Services\Oasis;
|
||||
|
||||
|
||||
use App\Models\Oasis\SubscriptionRequest;
|
||||
use App\Notifications\Oasis\ReminderForPaymentRequiredNotification;
|
||||
use App\Services\StripeService;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class OasisService
|
||||
{
|
||||
/**
|
||||
* Get requested subscription requests and remind via
|
||||
* email to activate order
|
||||
*/
|
||||
public function order_reminder()
|
||||
{
|
||||
SubscriptionRequest::whereStatus('requested')
|
||||
->get()
|
||||
->each(function ($request) {
|
||||
|
||||
// Get diffInHours
|
||||
$diff = Carbon::parse($request->created_at)
|
||||
->diffInHours(Carbon::now());
|
||||
|
||||
// Delete if file is in local storage more than 24 hours
|
||||
if ($diff >= 8) {
|
||||
|
||||
$plan = resolve(StripeService::class)
|
||||
->getPlan($request->requested_plan);
|
||||
|
||||
$request->user->notify(new ReminderForPaymentRequiredNotification(
|
||||
$request, $plan
|
||||
));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user