Return early

This commit is contained in:
David Bomba 2021-10-23 15:04:20 +11:00
parent 8dcdccb9c7
commit 31ef397dba
2 changed files with 4 additions and 1 deletions

View File

@ -27,7 +27,7 @@ class SwitchCompanyController extends Controller
->where('id', $this->transformKeys($contact)) ->where('id', $this->transformKeys($contact))
->first(); ->first();
Auth::guard('contact')->login($client_contact, true); auth()->guard('contact')->user()->login($client_contact, true);
return redirect('/client/dashboard'); return redirect('/client/dashboard');
} }

View File

@ -42,6 +42,9 @@ class EntityViewedObject
public function build() public function build()
{ {
if(!$this->entity)
return;
App::forgetInstance('translator'); App::forgetInstance('translator');
/* Init a new copy of the translator*/ /* Init a new copy of the translator*/
$t = app('translator'); $t = app('translator');