Skip to content

Instantly share code, notes, and snippets.

@OlabodeAbesin
Created June 29, 2020 20:01
Show Gist options
  • Save OlabodeAbesin/7d870e8c2b03d54352a7c65fe58bef76 to your computer and use it in GitHub Desktop.
Save OlabodeAbesin/7d870e8c2b03d54352a7c65fe58bef76 to your computer and use it in GitHub Desktop.
public function restore()
{
$array = [12906, 12973, 12978, 13045, 13051, 13107, 13111, 13183, 13186, 13249, 13250, 13166, 13167, 13169, 13234, 13236, 13219];
$failed = array();
foreach ($array as $key => $arrayvalue) {
try {
$transaction = Transaction::where('id', $arrayvalue)->first();
$transaction->restore();
} catch (\Throwable $th) {
$failed[] = $arrayvalue;
}
}
return $failed;
}
public function delete()
{
$array = [12906, 12973, 12978, 13045, 13051, 13107, 13111, 13183, 13186, 13249, 13250, 13166, 13167, 13169, 13234, 13236, 13219];
$failed = array();
foreach ($array as $key => $arrayvalue) {
try {
$transaction = Transaction::where('id', $arrayvalue)->delete();
} catch (\Throwable $th) {
$failed[] = $arrayvalue;
}
}
return $failed;
}
public function stashreverse(){
$array = [13251, 13248, 13247, 13196, 13150, 13072, 13064, 13041, 13037, 13035, 13028, 13027, 13019, 13018, 13017, 13014, 13008, 12965, 12960, 12953, 12927, 12885, 12767, 12762];
$failed = array();
foreach ($array as $key => $arrayvalue) {
try {
$transaction = Transaction::where('id', $arrayvalue)->first();
$response = Fineract::savings()->TMSundoTransaction($transaction->savingsId, $transaction->resourceId);
} catch (\Throwable $th) {
$failed[] = $arrayvalue;
}
}
return $failed;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment