I have this simple controller:
<?php
namespace App\Http\Controllers;
use Illuminate\Routing\Controller;
use Illuminate\Http\Request;
class TestController extends Controller
{
public function indexAction(Request $request)
{
return view('test');
}
}
It loads this simple view:
<!DOCTYPE html>
<html>
<head>
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
When I put it in the web middleware like this I get the Maximum function nesting level...
error:
Route::group(['middleware' => ['web']], function () {
Route::get('/test', 'TestController@indexAction');
});
If I take the route out of the middleware it works fine. I want to think this is an issue with TwigBridge, but I don't see anyone else reporting it. Is there something I may have missed in my setup?
Edit
Apparently I have to explain why this is not a duplicate of another question. This is specific to Laravel 5.2 and the TwigBridge plugin. It comes up as part of their source code. The item cited as a possible duplicate has nothing to do with Laravel and TwigBridge. This particular error can be generated any number of ways. It comes from xdebug. I'm simply asking what in Laravel, TwigBridge, or my code could be causing this error.
Edit 2
Here's my Kernel.php file as requested:
<?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' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
],
'api' => [
'throttle:60,1',
],
];
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
];
}