Last active
March 25, 2018 17:24
-
-
Save joaorobertopb/5863e88cb6e474ee19d3fbf98d47b0fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Scope; | |
use Illumiante\Database\Query\Builder as QueryBuilder; | |
use Illuminate\Database\Eloquent\Builder; | |
use illuminate\Database\Eloquent\ScopeInterface; | |
class MultiEmpresaScope implements ScopeInterface { | |
public function apply(Builder $builder) { | |
$empresaId = ''; //aqui você recupera o Id da Empresa, pode ser pela sessão, por variavel de ambiente e etc... | |
$builder->where('empresa_id', $empresaId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment