Ensure all files are deleted with the account

This commit is contained in:
Hillel Coren 2016-05-26 20:48:45 +03:00
parent b32a9110c7
commit 145c394e6b

View File

@ -1251,6 +1251,10 @@ class AccountController extends BaseController
$account = Auth::user()->account;
\Log::info("Canceled Account: {$account->name} - {$user->email}");
Document::scope()->each(function($item, $key) {
$item->delete();
});
$this->accountRepo->unlinkAccount($account);
if ($account->company->accounts->count() == 1) {
$account->company->forceDelete();