*/ public function middleware(): array { return [(new WithoutOverlapping('ip:notification-epoch-update'))->shared()->dontRelease()]; } /** * Create a new job instance. */ public function __construct() { // } /** * Execute the job. */ public function handle(): void { $pid = Cache::get(NotificationService::EPOCH_CACHE_KEY . '6'); if($pid && $pid > 1) { $rec = Notification::where('id', '>', $pid)->whereDate('created_at', now()->subMonths(6)->format('Y-m-d'))->first(); } else { $rec = Notification::whereDate('created_at', now()->subMonths(6)->format('Y-m-d'))->first(); } $id = 1; if($rec) { $id = $rec->id; } Cache::put(NotificationService::EPOCH_CACHE_KEY . '6', $id, 1209600); } }