Skip to content

Instantly share code, notes, and snippets.

@psgganesh
Last active May 27, 2020 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psgganesh/849809149ec58caf98456c530f5a06b4 to your computer and use it in GitHub Desktop.
Save psgganesh/849809149ec58caf98456c530f5a06b4 to your computer and use it in GitHub Desktop.
temp.php
<?php
use App\Models\Registration;
use App\Models\Subscription;
.
.
.
.
.
.
.
.
$registrations = Registration::where('is_revoked_by_batch', true)->get();
foreach($registrations as $registration) {
$serviceFlags = explode("|", $registration->subscriptions);
foreach ($serviceFlags as $serviceFlag) {
Subscription::where('username', $registration->username)
->where('service_flag', $serviceFlag)
->where('is_revoked', false)
->update([
'is_revoked' => true
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment