public function findPagesByURL($url)
    {
        $page = null;

        $page = $this->model->where('url', $url)->where('is_published', 1)->where('published_at', '<=', Carbon::now(config('app.timezone'))->format('Y-m-d H:i:s'))->first();

        if ($page && app()->getLocale() !== config('cms.default-language')) {
            $page = $this->translationRepo->findByEntityId($page->id, 'Grafite\Cms\Models\Page');
        }

        if (!$page) {
            $page = $this->translationRepo->findByUrl($url, 'Grafite\Cms\Models\Page');
        }

        if ($url === 'home' && app()->getLocale() !== config('cms.default-language')) {
            $page = $this->translationRepo->findByUrl($url, 'Grafite\Cms\Models\Page');
        }

        return $page;
    }
public function findPagesByURL($url)
    {
        $page = null;

        $page = $this->model->where('url', $url)->where('is_published', 1)->where('published_at', '<=', Carbon::now(config('app.timezone'))->format('Y-m-d H:i:s'))->first();

        if ($page && app()->getLocale() !== config('cms.default-language')) {
            $page = $this->translationRepo->findByEntityId($page->id, 'Grafite\Cms\Models\Page');
        }

        if (!$page) {
            $page = $this->translationRepo->findByUrl($url, 'Grafite\Cms\Models\Page');
        }

        if ($url === 'home' && app()->getLocale() !== config('cms.default-language')) {
            $page = $this->translationRepo->findByUrl($url, 'Grafite\Cms\Models\Page');
        }

        return $page;
    }
public function findPagesByURL ( $ url ) { $ page = null ; $ page = $ this -> model -> where ( 'url' , $ url ) -> where ( 'is_published' , 1 ) -> where ( 'published_at' , '<=' , Carbon :: now ( config ( 'app.timezone' ) ) -> format ( 'Y-m-d H:i:s' ) ) -> first ( ) ; if ( $ page && app ( ) -> getLocale ( ) !== config ( 'cms.default-language' ) ) { $ page = $ this -> translationRepo -> findByEntityId ( $ page -> id , 'Grafite\Cms\Models\Page' ) ; } if ( ! $ page ) { $ page = $ this -> translationRepo -> findByUrl ( $ url , 'Grafite\Cms\Models\Page' ) ; } if ( $ url === 'home' && app ( ) -> getLocale ( ) !== config ( 'cms.default-language' ) ) { $ page = $ this -> translationRepo -> findByUrl ( $ url , 'Grafite\Cms\Models\Page' ) ; } return $ page ; }
Find Pages by given URL.

@param string $url

@return \Illuminate\Support\Collection|null|static|Pages
Find Pages by given URL .