framework
framework copied to clipboard
Fix: Add SetRequestForConsole bootstrapper to the Kernel
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