protected function findMiddlewareFromFile($file)
    {
        $filename = pathinfo($file, PATHINFO_FILENAME);

        foreach ($this->middleware as $alias => $class) {
            if (strpos($class, $filename) !== false) {
                return $alias;
            }
        }
    }
protected function findMiddlewareFromFile($file)
    {
        $filename = pathinfo($file, PATHINFO_FILENAME);

        foreach ($this->middleware as $alias => $class) {
            if (strpos($class, $filename) !== false) {
                return $alias;
            }
        }
    }
protected function findMiddlewareFromFile ( $ file ) { $ filename = pathinfo ( $ file , PATHINFO_FILENAME ) ; foreach ( $ this -> middleware as $ alias => $ class ) { if ( strpos ( $ class , $ filename ) !== false ) { return $ alias ; } } }
Find the middleware alias from the file.

@param  string $file
@return string|null
Find the middleware alias from the file .