This commit is contained in:
denisdulici
2018-02-20 18:24:17 +03:00
parent 366a3052d3
commit 01c91b2391
6 changed files with 115 additions and 65 deletions

View File

@ -18,8 +18,8 @@ class Company implements Scope
*/
public function apply(Builder $builder, Model $model)
{
// Session not available in console
if (App::runningInConsole()) {
$company_id = session('company_id');
if (empty($company_id)) {
return;
}
@ -37,8 +37,6 @@ class Company implements Scope
}
// Apply company scope
$company_id = session('company_id');
$builder->where($table . '.company_id', '=', $company_id);
}