src/Utilities/Helper.php
public static function compileBlade($str, $data = [])
    {
        if (view()->exists($str)) {
            return view($str, $data)->render();
        }

        ob_start() && extract($data, EXTR_SKIP);
        eval('?>' . app('blade.compiler')->compileString($str));
        $str = ob_get_contents();
        ob_end_clean();

        return $str;
    }
public static function compileBlade($str, $data = [])
    {
        if (view()->exists($str)) {
            return view($str, $data)->render();
        }

        ob_start() && extract($data, EXTR_SKIP);
        eval('?>' . app('blade.compiler')->compileString($str));
        $str = ob_get_contents();
        ob_end_clean();

        return $str;
    }
public static function compileBlade ( $ str , $ data = [ ] ) { if ( view ( ) -> exists ( $ str ) ) { return view ( $ str , $ data ) -> render ( ) ; } ob_start ( ) && extract ( $ data , EXTR_SKIP ) ; eval ( '?>' . app ( 'blade.compiler' ) -> compileString ( $ str ) ) ; $ str = ob_get_contents ( ) ; ob_end_clean ( ) ; return $ str ; }
Parses and compiles strings by using Blade Template System.

@param string $str
@param array  $data
@return mixed
@throws \Exception
Parses and compiles strings by using Blade Template System .