src/Http/Controllers/PublicController.php
private function findPageByUri($uri)
    {
        $repository = $this->repository->with('images', 'documents', 'publishedSections');

        if ($uri === null) {
            return $repository->findBy('is_home', 1);
        }

        // Only locale in url
        if (
            in_array($uri, locales()) &&
            (
                config('app.fallback_locale') != $uri ||
                config('typicms.main_locale_in_url')
            )
        ) {
            return $repository->findBy('is_home', 1);
        }

        return $repository->getFirstByUri($uri);
    }
private function findPageByUri($uri)
    {
        $repository = $this->repository->with('images', 'documents', 'publishedSections');

        if ($uri === null) {
            return $repository->findBy('is_home', 1);
        }

        // Only locale in url
        if (
            in_array($uri, locales()) &&
            (
                config('app.fallback_locale') != $uri ||
                config('typicms.main_locale_in_url')
            )
        ) {
            return $repository->findBy('is_home', 1);
        }

        return $repository->getFirstByUri($uri);
    }
private function findPageByUri ( $ uri ) { $ repository = $ this -> repository -> with ( 'images' , 'documents' , 'publishedSections' ) ; if ( $ uri === null ) { return $ repository -> findBy ( 'is_home' , 1 ) ; } // Only locale in url if ( in_array ( $ uri , locales ( ) ) && ( config ( 'app.fallback_locale' ) != $ uri || config ( 'typicms.main_locale_in_url' ) ) ) { return $ repository -> findBy ( 'is_home' , 1 ) ; } return $ repository -> getFirstByUri ( $ uri ) ; }
Find page by URI.

@return TypiCMS\Modules\Pages\Models\Page
Find page by URI .