app/View.php
public function getFilenameForView(string $view_name): string
    {
        // If we request "::view", then use it explicityly.  Don't allow replacements.
        $explicit = Str::startsWith($view_name, self::NAMESPACE_SEPARATOR);

        if (!Str::contains($view_name, self::NAMESPACE_SEPARATOR)) {
            $view_name = self::NAMESPACE_SEPARATOR . $view_name;
        }

        // Apply replacements / customisations
        while (!$explicit && array_key_exists($view_name, self::$replacements)) {
            $view_name = self::$replacements[$view_name];
        }

        [$namespace, $view_name] = explode(self::NAMESPACE_SEPARATOR, $view_name, 2);

        if ((self::$namespaces[$namespace] ?? null) === null) {
            throw new RuntimeException('Namespace "' . e($namespace) .  '" not found.');
        }

        $view_file = self::$namespaces[$namespace] . $view_name . self::TEMPLATE_EXTENSION;

        if (!is_file($view_file)) {
            throw new RuntimeException('View file not found: ' . e($view_file));
        }

        return $view_file;
    }
public function getFilenameForView(string $view_name): string
    {
        // If we request "::view", then use it explicityly.  Don't allow replacements.
        $explicit = Str::startsWith($view_name, self::NAMESPACE_SEPARATOR);

        if (!Str::contains($view_name, self::NAMESPACE_SEPARATOR)) {
            $view_name = self::NAMESPACE_SEPARATOR . $view_name;
        }

        // Apply replacements / customisations
        while (!$explicit && array_key_exists($view_name, self::$replacements)) {
            $view_name = self::$replacements[$view_name];
        }

        [$namespace, $view_name] = explode(self::NAMESPACE_SEPARATOR, $view_name, 2);

        if ((self::$namespaces[$namespace] ?? null) === null) {
            throw new RuntimeException('Namespace "' . e($namespace) .  '" not found.');
        }

        $view_file = self::$namespaces[$namespace] . $view_name . self::TEMPLATE_EXTENSION;

        if (!is_file($view_file)) {
            throw new RuntimeException('View file not found: ' . e($view_file));
        }

        return $view_file;
    }
public function getFilenameForView ( string $ view_name ) : string { // If we request "::view", then use it explicityly.  Don't allow replacements. $ explicit = Str :: startsWith ( $ view_name , self :: NAMESPACE_SEPARATOR ) ; if ( ! Str :: contains ( $ view_name , self :: NAMESPACE_SEPARATOR ) ) { $ view_name = self :: NAMESPACE_SEPARATOR . $ view_name ; } // Apply replacements / customisations while ( ! $ explicit && array_key_exists ( $ view_name , self :: $ replacements ) ) { $ view_name = self :: $ replacements [ $ view_name ] ; } [ $ namespace , $ view_name ] = explode ( self :: NAMESPACE_SEPARATOR , $ view_name , 2 ) ; if ( ( self :: $ namespaces [ $ namespace ] ?? null ) === null ) { throw new RuntimeException ( 'Namespace "' . e ( $ namespace ) . '" not found.' ) ; } $ view_file = self :: $ namespaces [ $ namespace ] . $ view_name . self :: TEMPLATE_EXTENSION ; if ( ! is_file ( $ view_file ) ) { throw new RuntimeException ( 'View file not found: ' . e ( $ view_file ) ) ; } return $ view_file ; }
Find the file for a view.

@param string $view_name

@return string
@throws Exception
Find the file for a view .