laravel Examples
List middleware of application

List middleware of application

Route::get('middleware', function() {
    $collection = collect(Route::getRoutes())->map(function($r){
        if(isset($r->action['middleware']))
            return $r->action['middleware'];
    })->flatten();
    return array_unique($collection->toArray());
});

Leave a Reply

Your email address will not be published. Required fields are marked *