src/App/RoutesBase.php
public static function withLanguage(\Closure $callback, $config = [])
    {
        if (\App::runningUnitTests()) {
            $locale = \App::getLocale();
        } else {
            $locale = request()->segment(1);
        }

        if (strlen($locale) <= 2) {
            Route::group(['prefix' => $locale, 'middleware' => 'lang'], function () use ($callback) {
                $callback();
            });
        }
    }
public static function withLanguage(\Closure $callback, $config = [])
    {
        if (\App::runningUnitTests()) {
            $locale = \App::getLocale();
        } else {
            $locale = request()->segment(1);
        }

        if (strlen($locale) <= 2) {
            Route::group(['prefix' => $locale, 'middleware' => 'lang'], function () use ($callback) {
                $callback();
            });
        }
    }
public static function withLanguage ( \ Closure $ callback , $ config = [ ] ) { if ( \ App :: runningUnitTests ( ) ) { $ locale = \ App :: getLocale ( ) ; } else { $ locale = request ( ) -> segment ( 1 ) ; } if ( strlen ( $ locale ) <= 2 ) { Route :: group ( [ 'prefix' => $ locale , 'middleware' => 'lang' ] , function ( ) use ( $ callback ) { $ callback ( ) ; } ) ; } }
Wraps routes with language prefix

@param \Closure $callback
@param array $config
Wraps routes with language prefix