Issue
In public\index.php
, I just dump the $kernel
variable like this:
$app = require_once __DIR__.'/../bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
dd($kernel);die;
The result of passing $kernel
to dd()
is Illuminate\Foundation\Http\Kernel
not Illuminate\Contracts\Http\Kernel
. How is Illuminate\Foundation\Http\Kernel
created?
Solution
Laravel knows how to resolve the instance given the bindings in bootstrap/app.php
:
$app->singleton(
Illuminate\Contracts\Http\Kernel::class,
App\Http\Kernel::class
);
Answered By - adam
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.