Skip to content

Commit 6d7ca4c

Browse files
authored
Adding addScopes function to Services/DataTables
Hello, i'm adding addScopes function, to push multiples scopes to the query scope array in one go. i think it's useful, it's avoid multiple addScope chaining. thanks.
1 parent 241c47f commit 6d7ca4c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Services/DataTable.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,19 @@ public function addScope(DataTableScope $scope)
446446

447447
return $this;
448448
}
449+
450+
/**
451+
* Push multiples scopes to array query scopes.
452+
*
453+
* @param array $scopes
454+
* @return $this
455+
*/
456+
public function addScopes(array $scopes)
457+
{
458+
array_push($this->scopes, $scopes);
459+
460+
return $this;
461+
}
449462

450463
/**
451464
* Set a custom class attribute.

0 commit comments

Comments
 (0)