We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents dbde853 + d57d2ec commit 04fd0edCopy full SHA for 04fd0ed
src/Services/DataTable.php
@@ -570,6 +570,23 @@ protected function applyScopes($query)
570
return $query;
571
}
572
573
+ /**
574
+ * Determine if the DataTable has scopes.
575
+ *
576
+ * @param array $scopes
577
+ * @param bool $validateAll
578
+ * @return bool
579
+ */
580
+ protected function hasScopes(array $scopes, $validateAll = false)
581
+ {
582
+ $filteredScopes = array_filter($this->scopes, function ($scope) use ($scopes) {
583
+ return in_array(get_class($scope), $scopes);
584
+ });
585
+
586
+ return $validateAll ? count($filteredScopes) === count($scopes) :
587
+ ! empty($filteredScopes);
588
+ }
589
590
/**
591
* Get default builder parameters.
592
*
0 commit comments