Skip to content

Commit

Permalink
Fix Closure Middleware Can't Converted As String (#1146)
Browse files Browse the repository at this point in the history
  • Loading branch information
SupianIDz authored Apr 5, 2021
1 parent 9c5f09b commit a089537
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/DataCollector/RouteCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Barryvdh\Debugbar\DataCollector;

use Closure;
use DebugBar\DataCollector\DataCollector;
use DebugBar\DataCollector\Renderable;
use Illuminate\Http\Request;
Expand Down Expand Up @@ -95,7 +96,9 @@ protected function getRouteInformation($route)
*/
protected function getMiddleware($route)
{
return implode(', ', $route->middleware());
return implode(', ', array_map(function ($middleware) {
return $middleware instanceof Closure ? 'Closure' : $middleware;
}, $route->middleware()));
}

/**
Expand Down

0 comments on commit a089537

Please sign in to comment.