wip(Notification system)
This commit is contained in:
33
app/Jobs/SendSubscriptionExpiredPhase1Notifications.php
Normal file
33
app/Jobs/SendSubscriptionExpiredPhase1Notifications.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Models\Member;
|
||||
use App\Notifications\SubscriptionExpiredPhase1;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Queue\Queueable;
|
||||
|
||||
class SendSubscriptionExpiredPhase1Notifications implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
Member::isExpired()
|
||||
->chunk(100, function ($members) {
|
||||
foreach ($members as $member) {
|
||||
$member->notify(new SubscriptionExpiredPhase1());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user