message: Non-static method Fouladgar\EloquentBuilder\EloquentBuilder::to() should not be called statically
Closed this issue · 8 comments
Laravel 6.
What's the problem?
@realSaeedHassani You should use the facade of EloquentBuilder.
Please look at the example usage below:
// Facade usage
use EloquentBuilder;
$users = EloquentBuilder::to(\App\User::class,YOUR_FILTERS)->get();
@realSaeedHassani I will close this issue.
If does not resolved issue, feel free to reopen it.
@realSaeedHassani You should use the facade of EloquentBuilder.
Please look at the example usage below:// Facade usage use EloquentBuilder; $users = EloquentBuilder::to(\App\User::class,YOUR_FILTERS)->get();
Works fine.
Don't solved, Laravel 7.x
@realSaeedHassani You should use the facade of EloquentBuilder.
Please look at the example usage below:// Facade usage use EloquentBuilder; $users = EloquentBuilder::to(\App\User::class,YOUR_FILTERS)->get();
Works fine.
Undefined type 'EloquentBuilder'
@multiarts Could you give us a view from your code?
@multiarts I can't see a good reason for it. Please use it as your first image, then run a composer dump
. It might related to composer autoload.
@multiarts I can't see a good reason for it. Please use it as your first image, then run a
composer dump
. It might related to composer autoload.
To solve the problem, I added before the Request facade.
use EloquentBuilder;
use Illuminate\Http\Request;