where('session_expire', '<', time()) ->where('session_remember', '!=', 1) ->delete(); // Delete notifications that are older than a month but not unread DB::table('notifications') ->where('alert_timestamp', '<', (time() - 109500)) ->where('alert_read', 1) ->delete(); // Get expired premium accounts $expiredPremium = DB::table('premium') ->where('premium_expire', '<', time()) ->get(); // Process expired premium accounts, make this not stupid in the future foreach ($expiredPremium as $expired) { Users::updatePremiumMeta($expired->user_id); }