L4 Routes like L5

Submitted by sr2ds - 5 years ago

One file for all routes is bad idea. For simplify this, look this snippets.

// helpers.php
if (!function_exists('routes')) {
    /**
     * Return Routes Path
     * @return string
     */
    function routes()
    {
        return app_path() . '/Routes/';
    }
}

// routes.php
Route::group(array('prefix' => 'admin', 'before' => 'auth|inGroup:Administrators'), function () {
    require(routes(). 'Admin.php');
});

// Now your admin routes are Routes/Admin.php