Laravel 5.3 Auth check - Session store not set on request
<p>I'm starting a new app in 5.3 and want to implement the solution for the auth check as stated <a href="https://laravel.com/docs/5.3/upgrade#5.3-session-in-constructors" rel="nofollow noreferrer">here</a></p>

<p>I'm using the register and login models out of the box for 5.3. I've only worked a month on Laravel so struggling to fully interpret the solution.
I moved the HomeController.php to the Auth folder under controllers and added the following <code>use</code> statements: <code>use App\User;
use Illuminate\Support\Facades\Auth;
</code> I editd the HomeController constructor as follow:</p>

<pre><code>public function __construct()
{
    //$this-&gt;middleware('auth');
    $this-&gt;middleware(function ($request, $next) {
        $this-&gt;user= Auth::user();
        return $next($request);
    });
}
</code></pre>

<p>Here's my controller screenshot. <a href="https://i.stack.imgur.com/nBJkq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nBJkq.png" alt="enter image description here"></a></p>

<p>Still get the "Session store not set on request." error when I try to register.
I read <a href="https://stackoverflow.com/questions/39175252/cant-call-authuser-on-controllers-constructor">this answer</a> as well, but need more guidance please. Just want to get 5.3 out of the box authentication to work.
Here is my Auth folder structure.</p>

<p><a href="https://i.stack.imgur.com/trl0Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/trl0Z.png" alt="enter image description here"></a></p>

<p>Here is my routes/web.php</p>

<p><a href="https://i.stack.imgur.com/joTXe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/joTXe.png" alt="enter image description here"></a></p>

<p>RouteServiceProvider.php</p>

<pre><code>&lt;?php

namespace App\Providers;

use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;

class RouteServiceProvider extends ServiceProvider
{
 protected $namespace = 'App\Http\Controllers';

/**
 * Define your route model bindings, pattern filters, etc.
 *
 * @return void
 */
public function boot()
{
    //

    parent::boot();
}

/**
 * Define the routes for the application.
 *
 * @return void
 */
public function map()
{
    $this-&gt;mapApiRoutes();

    $this-&gt;mapWebRoutes();

    //
}

/**
 * Define the "web" routes for the application.
 *
 * These routes all receive session state, CSRF protection, etc.
 *
 * @return void
 */
protected function mapWebRoutes()
{
    Route::group([
        'middleware' =&gt; 'web',
        'namespace' =&gt; $this-&gt;namespace,
    ], function ($router) {
        require base_path('routes/web.php');
    });
}

/**
 * Define the "api" routes for the application.
 *
 * These routes are typically stateless.
 *
 * @return void
 */
protected function mapApiRoutes()
{
    Route::group([
        'middleware' =&gt; 'api',
        'namespace' =&gt; $this-&gt;namespace,
        'prefix' =&gt; 'api',
    ], function ($router) {
        require base_path('routes/api.php');
    });
}
}
</code></pre>

<p>The Kernel:</p>

<pre><code>&lt;?php

namespace App\Http;

use Illuminate\Foundation\Http\Kernel as HttpKernel;

class Kernel extends HttpKernel
{
/**
 * The application's global HTTP middleware stack.
 *
 * These middleware are run during every request to your application.
 *
 * @var array
 */
protected $middleware = [
    \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
];

/**
 * The application's route middleware groups.
 *
 * @var array
 */
protected $middlewareGroups = [
    'web' =&gt; [
        \App\Http\Middleware\EncryptCookies::class,
        \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
        \App\Http\Middleware\VerifyCsrfToken::class,
        \Illuminate\Session\Middleware\StartSession::class,
        \Illuminate\View\Middleware\ShareErrorsFromSession::class,                    
        \Illuminate\Routing\Middleware\SubstituteBindings::class,
    ],

    'api' =&gt; [
        'throttle:60,1',
        'bindings',
    ],
];

/**
 * The application's route middleware.
 *
 * These middleware may be assigned to groups or used individually.
 *
 * @var array
 */
protected $routeMiddleware = [
    'auth' =&gt; \Illuminate\Auth\Middleware\Authenticate::class,
    'auth.basic' =&gt; \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
    'bindings' =&gt; \Illuminate\Routing\Middleware\SubstituteBindings::class,
    'can' =&gt; \Illuminate\Auth\Middleware\Authorize::class,
    'guest' =&gt; \App\Http\Middleware\RedirectIfAuthenticated::class,
    'throttle' =&gt; \Illuminate\Routing\Middleware\ThrottleRequests::class,
];
}
</code></pre>