public static function detectLanguageFromRequest(Request $request)
    {
        $splitURL = explode("/", $request->path());
        if(isset($splitURL[0])) {
            // validate language
            if(self::findBySlug($splitURL[0])) {
                return $splitURL[0];
            }
        }
        return false;
    }
public static function detectLanguageFromRequest(Request $request)
    {
        $splitURL = explode("/", $request->path());
        if(isset($splitURL[0])) {
            // validate language
            if(self::findBySlug($splitURL[0])) {
                return $splitURL[0];
            }
        }
        return false;
    }
public static function detectLanguageFromRequest ( Request $ request ) { $ splitURL = explode ( "/" , $ request -> path ( ) ) ; if ( isset ( $ splitURL [ 0 ] ) ) { // validate language if ( self :: findBySlug ( $ splitURL [ 0 ] ) ) { return $ splitURL [ 0 ] ; } } return false ; }
Detect language slug from a request

@param  Request $request
@return bool
@throws \Exception
Detect language slug from a request