protected static function classFromFile(SplFileInfo $file, $basePath)
    {
        $class = trim(str_replace($basePath, '', $file->getRealPath()), DIRECTORY_SEPARATOR);

        return str_replace(
            [DIRECTORY_SEPARATOR, 'App\\'],
            ['\\', app()->getNamespace()],
            ucfirst(Str::replaceLast('.php', '', $class))
        );
    }
protected static function classFromFile(SplFileInfo $file, $basePath)
    {
        $class = trim(str_replace($basePath, '', $file->getRealPath()), DIRECTORY_SEPARATOR);

        return str_replace(
            [DIRECTORY_SEPARATOR, 'App\\'],
            ['\\', app()->getNamespace()],
            ucfirst(Str::replaceLast('.php', '', $class))
        );
    }
protected static function classFromFile ( SplFileInfo $ file , $ basePath ) { $ class = trim ( str_replace ( $ basePath , '' , $ file -> getRealPath ( ) ) , DIRECTORY_SEPARATOR ) ; return str_replace ( [ DIRECTORY_SEPARATOR , 'App\\' ] , [ '\\' , app ( ) -> getNamespace ( ) ] , ucfirst ( Str :: replaceLast ( '.php' , '' , $ class ) ) ) ; }
Extract the class name from the given file path.

@param  \SplFileInfo  $file
@param  string  $basePath
@return string
Extract the class name from the given file path .