laravel/framework — pull request #6611 by markhuot (2014-12-09 22:28:44+00:00)
Title: Ensures that the response is an actual Response.

When using the CSRF protection as a routing middleware, not applied in `kernel.php` it breaks because the controller/route could return a `View` instead of a `Response`. This is one potential fix.

Another approach would be to have the `view` function wrap the view in a `Response` to avoid this too.

e.g.

```php
class AuthController extends Controller {

/**
* Create a new authentication controller instance.
*
* @param Guard $auth
* @return void
*/
public function __construct(Guard $auth)
{
$this->middleware('csrf');
}

/**
* Show the application registration form.
*
* @return Response
*/
public function getRegister()
{
return view('auth.login');
}
```

The above returns a view to the middleware, where a response is expected.