public function scopes(array $scopes)
{
$builder = $this;
foreach ($scopes as $scope => $parameters) {
if (is_int($scope)) {
list($scope, $parameters) = [$parameters, []];
}
$builder = $builder->callScope([$this->model, 'scope' . ucfirst($scope)], (array) $parameters);
}
return $builder;
}
/** * Add the given scopes to the current builder instance. * * @param array $scopes * @return mixed * @static */ public static function scopes($scopes) { return \Illuminate\Database\Eloquent\Builder::scopes($scopes); }