Skip to content

Commit

Permalink
fire event after company switched
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Dec 28, 2017
1 parent 5ce9136 commit 31e58a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/Http/Controllers/Companies/Companies.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Controllers\Companies;

use App\Events\CompanySwitched;
use App\Http\Controllers\Controller;
use App\Http\Requests\Company\Company as Request;
use App\Models\Company\Company;
Expand Down Expand Up @@ -182,9 +183,10 @@ public function set(Company $company)
// Check if user can manage company
if ($this->isUserCompany($company)) {
session(['company_id' => $company->id]);

event(new CompanySwitched($company));
}

//return redirect('/');
return redirect()->back();
}

Expand Down

0 comments on commit 31e58a2

Please sign in to comment.