Skip to content

Commit c3e58ee

Browse files
authored
fix applyScopes method to support Collection
This pull request fix the issue that when we create a DataTable service from `php artisan datatables:make` command, the service cannot support CollectionDatatable because applyScopes method in Yajra\DataTables\Services\DataTable class only support EloquentBuilder|QueryBuilder|EloquentRelation.
1 parent 6332449 commit c3e58ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Services/DataTable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -713,10 +713,10 @@ public function __get(string $key)
713713
/**
714714
* Apply query scopes.
715715
*
716-
* @param EloquentBuilder|QueryBuilder|EloquentRelation $query
717-
* @return EloquentBuilder|QueryBuilder|EloquentRelation
716+
* @param EloquentBuilder|QueryBuilder|EloquentRelation|Collection $query
717+
* @return EloquentBuilder|QueryBuilder|EloquentRelation|Collection
718718
*/
719-
protected function applyScopes(EloquentBuilder|QueryBuilder|EloquentRelation $query): EloquentBuilder|QueryBuilder|EloquentRelation
719+
protected function applyScopes(EloquentBuilder|QueryBuilder|EloquentRelation|Collection $query): EloquentBuilder|QueryBuilder|EloquentRelation|Collection
720720
{
721721
foreach ($this->scopes as $scope) {
722722
$scope->apply($query);

0 commit comments

Comments
 (0)