diff --git a/src/Grid/Filter.php b/src/Grid/Filter.php index 133a05c340..89b12f50d5 100644 --- a/src/Grid/Filter.php +++ b/src/Grid/Filter.php @@ -422,6 +422,16 @@ public function scope($key, $label = '') }); } + /** + * Add separator in filter scope. + * + * @return mixed + */ + public function scopeSeparator() + { + return $this->scope(Scope::SEPARATOR); + } + /** * Get all filter scopes. * diff --git a/src/Grid/Filter/Scope.php b/src/Grid/Filter/Scope.php index a423316fba..2040e104d2 100644 --- a/src/Grid/Filter/Scope.php +++ b/src/Grid/Filter/Scope.php @@ -9,6 +9,7 @@ class Scope implements Renderable { const QUERY_NAME = '_scope_'; + const SEPARATOR = '_separator_'; /** * @var string @@ -66,6 +67,10 @@ public function condition() */ public function render() { + if ($this->key == static::SEPARATOR) { + return ''; + } + $url = request()->fullUrlWithQuery([static::QUERY_NAME => $this->key]); return "
  • {$this->label}
  • ";