framework icon indicating copy to clipboard operation
framework copied to clipboard

Fix: Add SetRequestForConsole bootstrapper to the Kernel

Open karasibille opened this issue 2 years ago • 0 comments

When using the Eloquent query builder pagination methods, like this :

DB::table('users')->paginate(perPage: 15, page: 1);

Laravel tries to acces the request binding — and by doing so throws this Exception :

Illuminate\Contracts\Container\BindingResolutionException

Target class [request] does not exist.

To fix this error, we add this class to the bootstrappers list of the Kernel :

\Illuminate\Foundation\Bootstrap\SetRequestForConsole::class

Ref https://github.com/laravel-zero/laravel-zero/issues/478

karasibille avatar Jan 04 '24 15:01 karasibille