protected function determineLocaleAndQuery($locale, $query)
    {
        if (is_null($query))
        {
            $modelName = $this->getViewModelName();

            $query = with(new $modelName)->newQuery();
        }

        if ($locale)
        {
            $query->where('locale', $locale);
        }

        return $query;
    }
protected function determineLocaleAndQuery($locale, $query)
    {
        if (is_null($query))
        {
            $modelName = $this->getViewModelName();

            $query = with(new $modelName)->newQuery();
        }

        if ($locale)
        {
            $query->where('locale', $locale);
        }

        return $query;
    }
protected function determineLocaleAndQuery ( $ locale , $ query ) { if ( is_null ( $ query ) ) { $ modelName = $ this -> getViewModelName ( ) ; $ query = with ( new $ modelName ) -> newQuery ( ) ; } if ( $ locale ) { $ query -> where ( 'locale' , $ locale ) ; } return $ query ; }
Determines the query and locale

@param $locale
@param $query
@return mixed
Determines the query and locale