This commit is contained in:
denisdulici
2018-11-10 15:52:56 +03:00
parent 3b3379833d
commit 17be9fa205
3 changed files with 32 additions and 67 deletions

View File

@@ -18,11 +18,6 @@ class Company implements Scope
*/
public function apply(Builder $builder, Model $model)
{
$company_id = session('company_id');
if (empty($company_id)) {
return;
}
$table = $model->getTable();
// Skip for specific tables
@@ -37,7 +32,7 @@ class Company implements Scope
}
// Apply company scope
$builder->where($table . '.company_id', '=', $company_id);
$builder->where($table . '.company_id', '=', session('company_id'));
}
/**