Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Call to a member function translate() on null Symfony\Component\Debug\Exception\FatalThrowableError thrown with message "Call to a member function translate() on null" Stacktrace: #0 Symfony\Component\Debug\Exception\FatalThrowableError in /home/optimotours/core-frmwork/app/Http/Controllers/Site/ArticleController.php:78
Application frames (1) All frames (1)
0
Symfony
\
Component
\
Debug
\
Exception
\
FatalThrowableError
/
app
/
Http
/
Controllers
/
Site
/
ArticleController.php
78
/
home
/
optimotours
/
core-frmwork
/
app
/
Http
/
Controllers
/
Site
/
ArticleController.php
    $data                 = unserialize($setting->data);
    $lang                 = App::getLocale() ;
    $meta_description     = ($article->meta_description) ? $article->meta_description : @$data['content'][$lang];
    $meta_keywords        = ($article->meta_keywords) ? $article->meta_keywords : @$data['keywords'][$lang];
 
    SEO::setTitle($article->title.' | '.@$data['title'][$lang]);
    SEO::setDescription(str_limit($meta_description , 160,''));
    SEOMeta::addKeyword($meta_keywords);
 
    $category        = Category::find($article->category_id);
    $ancestors = $category->getAncestorsAndSelfWithoutRoot();
    return view('block.page.show')->withArticle($article)
    ->withSection($category->section)
    ->withCategories($ancestors);
  }
 
  public function getCategory($slug)
  {
    $category = Category::whereTranslation('slug', $slug)->first();
    if ($category->translate()->slug != $slug) {
      return redirect()->route('ShowCategory', [$category->translate()->slug]);
    }
    $section = 'news';
    // $root        = Category::Section($section)->orderBy('lft', 'asc')->first();
    // $articles    = Article::Publish()->Section($section)->paginate(15);
    $articles    = Article::Publish()->where('category_id', $category->id)->latest()->paginate(8);
 
    $setting = Setting::where('name', 'site')->first();
    $data   = unserialize($setting->data);
    $lang = App::getLocale() ;
    SEO::setTitle( __(ucfirst($section)).' | '.@$data['title'][$lang]);
    SEO::setDescription(str_limit(@$data['content'][$lang] , 160,''));
    $keywords  = preg_split( '/\r\n|\r|\n/', @$data['keywords'][$lang] );
    SEOMeta::addKeyword($keywords);
    return view('block.page.index-category')
    ->withcategory($category)
    ->withSection($section)
    ->withArticles($articles);
  }
 

Exception thrown when handling an exception (ErrorException: get_cfg_var() has been disabled for security reasons)

(1/1) ErrorException

get_cfg_var() has been disabled for security reasons