-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exceptions using Query Builder of Laravel #3
Comments
Hi! |
Hello again, My Laravel version is: 5.2.39 (latest I think) |
First of all, EloquentDataProvider it will not work with DB::select() becouse it returns array of results. Second example should work, I will try to chek it now. |
Can you provide exception trace for second exception: ErrorException in Builder.php line 2345:
Call to undefined method Illuminate\Database\Query\Builder::getQuery() |
Looks like I found a bug. You can try to remove this method call from \ViewComponents\Eloquent\Processor\PaginateProcessor in your vendors folder (temporary) and give me know if it helped. If so, I can release bugfix just now |
Sorry I couldn't catch you up. I commented the
section and returned the $src untouched, and it seems working now. |
Bugfix released in v1.2.1 |
And use it this way: $query = DB::table('table_name')->where('id','>','1');
$provider = new EloquentDataProvider($query); Or $provider = new EloquentDataProvider(MyEloquentModel::class); Or $provider = new EloquentDataProvider(MyEloquentModel::where('id','>','1')); |
Thank you very much. |
Hello,
First, thanks for the all of your work.
I am trying to use the Grid component in my Laravel project with eloquent-data-processing library.
It is working well while using eloquent data models, but not working with using the query builder as data source.
I'm using it like:
use DB;
$query = DB::select('select * from table_name where ID = 1');
or
$query = DB::table('table_name')->where('id','=','1');
with
$provider = new EloquentDataProvider($query);
For the first one I'm getting:
And for the second one:
Obviously I'm doing something wrong. I need to get it work by using raw sql queries. Can you help me with the issue?
Thank you.
The text was updated successfully, but these errors were encountered: