Fixes for restoring models

This commit is contained in:
David Bomba 2021-09-22 07:45:06 +10:00
parent 19910d2867
commit 0c89f998eb

View File

@ -55,7 +55,10 @@ class CompanyGatewayObserver
public function restored(CompanyGateway $company_gateway) public function restored(CompanyGateway $company_gateway)
{ {
//When we restore the gateway, bring back the tokens! //When we restore the gateway, bring back the tokens!
ClientGatewayToken::where('company_gateway_id', $company_gateway->id)->withTrashed()->get()->restore(); ClientGatewayToken::where('company_gateway_id', $company_gateway->id)
->withTrashed()->cursor()->each(function ($cgt){
$cgt->restore();
});
} }
/** /**