Kyslik / column-sortable

Package for handling column sorting in Laravel 5/6/7/8
MIT License
644 stars 105 forks source link

You cannot use the word 'scope' as a column name. #117

Closed pbgswd closed 5 years ago

pbgswd commented 5 years ago

I had 'scope' as a column name in my table. I found on line 24 of /src/ColumnSortable/Sortable.php
public function scopeSortable($query, $defaultParameters = null) I got a 503 bad gateway in nginx when hitting that column sort in my browser. I changed the table column name to access_level with a migration, replaced elsewhere it was applicable, and it worked thereafter. I did not look into the matter any farther than this, it just worked afterwards.

Kyslik commented 5 years ago

I guess its limitation of scopes - https://laravel.com/docs/5.8/eloquent#query-scopes