Laravel会话/中间件/认证问题

Using standard out of the box authentication (have just pulled the code from 5.7 into my app), if the user enters the correct login details they get authenticated.

If they enter the incorrect details, in my local environment (Laradock), a flash message displays saying the login details were incorrect.

On my test environment (Ubuntu 16.04, PHP 7.1 etc) the page triggers an exception instead with the following errors in log:

Call to a member function setCookie() on null {"exception":{}}
Argument 1 passed to Illuminate\Session\Middleware\StartSession::addCookieToResponse() must be an instance of Symfony\Component\HttpFoundation\Response, instance of Illuminate\View\View given, called in /home/webuser/dafk/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php on line 71 {"exception":{}}
Argument 1 passed to Illuminate\Cookie\Middleware\EncryptCookies::encrypt() must be an instance of Symfony\Component\HttpFoundation\Response, instance of Illuminate\View\View given, called in /home/webuser/dafk/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php on line 66 {"exception":{}}

So far I've tried:

  1. Made sure all Middleware returns as appropriate
  2. Made sure the Kernel is calling all appropriate middleware
  3. Made sure all routes are wrapped with Middleware as appropriate
  4. Upgrade Laravel and reinstalled all composer modules
  5. Aligning my middleware with the Laravel 5.7 repo
  6. Checked Laravel and PHP session file permissions and ensured they're being written as expected

Not too sure where to go with this from here. It seems to be an environment issue, but most things seem to line up. Help appreciated.