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;
}