mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 01:17:33 -04:00 
			
		
		
		
	Fix for deleting account
This commit is contained in:
		
							parent
							
								
									e5e65c0349
								
							
						
					
					
						commit
						faec0a2f04
					
				| @ -1248,8 +1248,9 @@ class AccountController extends BaseController | |||||||
|         $this->accountRepo->unlinkAccount($account); |         $this->accountRepo->unlinkAccount($account); | ||||||
|         if ($account->company->accounts->count() == 1) { |         if ($account->company->accounts->count() == 1) { | ||||||
|             $account->company->forceDelete(); |             $account->company->forceDelete(); | ||||||
|         } |         } else { | ||||||
|             $account->forceDelete(); |             $account->forceDelete(); | ||||||
|  |         } | ||||||
| 
 | 
 | ||||||
|         Auth::logout(); |         Auth::logout(); | ||||||
|         Session::flush(); |         Session::flush(); | ||||||
|  | |||||||
| @ -49,7 +49,7 @@ class EnterprisePlan extends Migration | |||||||
|             Schema::table('accounts', function($table) |             Schema::table('accounts', function($table) | ||||||
|             { |             { | ||||||
|                 $table->unsignedInteger('company_id')->nullable(); |                 $table->unsignedInteger('company_id')->nullable(); | ||||||
|                 $table->foreign('company_id')->references('id')->on('companies'); |                 $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade'); | ||||||
|             }); |             }); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user