display routes and it's sub routes as a list in laravel
<p>Suppose I have these route definition in <code>routes.php</code> file:  </p>

<pre><code>Route::group(
            array (
                'prefix' =&gt; 'admin'
            ),
            function () {

                        Route::group(['prefix' =&gt; 'user'], function () {
                            Route::get('usersData', ['as' =&gt; 'usersData', 'uses' =&gt; 'UserController@usersData']);
                            Route::get('getOrgLevelAsJson/{user_id}', ['uses' =&gt; 'UserController@getOrgLevelAsJson']);
                        });
                        Route::resource('/user', 'UserController');

                        Route::group(['prefix' =&gt; 'role'], function () {
                            Route::get('rolesData', ['as' =&gt; 'rolesData', 'uses' =&gt; 'RoleController@rolesData']);
                            Route::post('applyPerms', ['as' =&gt; 'applyPerms', 'uses' =&gt; 'RoleController@applyPerms']);
                        });
                        Route::resource('/role', 'RoleController');

                    }
                );
            }
        );
</code></pre>

<p>And now for some reason I want to display these routes and it's sub routes as an unordered list like this:</p>

<pre><code>&lt;ul&gt;
    &lt;li&gt;admin/user
        &lt;ul&gt;
            &lt;li&gt;usersData&lt;/li&gt;
            &lt;li&gt;getOrgLevelAsJson/{user_id}&lt;/li&gt;
            &lt;li&gt;create&lt;/li&gt;
            &lt;li&gt;user/{user}&lt;/li&gt;
            &lt;li&gt;{user}/edit&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/li&gt;

    &lt;li&gt;admin/role
        &lt;ul&gt;
            &lt;li&gt;applyPerms&lt;/li&gt;
            &lt;li&gt;rolesData&lt;/li&gt;
            &lt;li&gt;create&lt;/li&gt;
            &lt;li&gt;role/{role}&lt;/li&gt;
            &lt;li&gt;role/{role}/edit&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>I know that can use <code>Route::getRoutes()</code> to get all defined routes but I do not know how can get a route then sub routes of that.</p>

<p>I am using Laravel 5.2 .</p>