Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Call to a member function tags() on null Symfony\Component\Debug\Exception\FatalThrowableError thrown with message "Call to a member function tags() on null" Stacktrace: #0 Symfony\Component\Debug\Exception\FatalThrowableError in /var/www/html/glancier.co.zw/app/Http/Controllers/WebController.php:267
Application frames (1) All frames (1)
0
Symfony
\
Component
\
Debug
\
Exception
\
FatalThrowableError
/
app
/
Http
/
Controllers
/
WebController.php
267
/
var
/
www
/
html
/
glancier.co.zw
/
app
/
Http
/
Controllers
/
WebController.php
        return view('glancier.tag')->with($data);
        return view('web.tag')->with($data);
    }
 
    public function details($slug) {
 
        //dd("Here");
        $blog_key = 'blog_' . $slug;
    
        //I Added
        $posts = Post::all();
 
 
        if (!Session::has($blog_key)) {
            Post::where('post_slug', $slug)->increment('view_count');
            Session::put($blog_key, 1);
        }
        $post = Post::where(['post_slug' => $slug, 'publication_status' => 1])->first();
   
        $post_tags = $post->tags()->get();
        //dd($post_tags);
 
 
        $post_type =  $post->category->category_name;
 
        //dd($post_type);
 
 
        if (!empty($post)) {
        $comments = Comment::where(['post_id' => $post->id, 'parent_comment_id' => NULL, 'publication_status' => 1])->orderBy('id', 'desc')->get();
        $related_posts = Post::where(['category_id' => $post->category->id, 'publication_status' => 1])->orderBy('post_date', 'desc')->limit(9)->get();
 
        $categories = $this->categories;
        $tags = $this->tags;
        $setting=$this->setting;
 
        $data = array(
                     'title' => 'contact', 
                     'current'=>'details',
                     'subCurrent'=>    'Detailed-'.$post_type ,
Arguments
  1. "Call to a member function tags() on null"
    

Environment & details:

empty
empty
empty
empty
empty
Key Value
REDIRECT_SCRIPT_URL
"/details/solar_farm_project"
REDIRECT_SCRIPT_URI
"https://www.glancier.co.zw/details/solar_farm_project"
REDIRECT_HTTPS
"on"
REDIRECT_SSL_TLS_SNI
"www.glancier.co.zw"
REDIRECT_STATUS
"200"
SCRIPT_URL
"/details/solar_farm_project"
SCRIPT_URI
"https://www.glancier.co.zw/details/solar_farm_project"
HTTPS
"on"
SSL_TLS_SNI
"www.glancier.co.zw"
HTTP_ACCEPT
"*/*"
HTTP_USER_AGENT
"claudebot"
HTTP_REFERER
"http://glancier.co.zw/details/solar_farm_project"
HTTP_HOST
"www.glancier.co.zw"
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
SERVER_SIGNATURE
"<address>Apache/2.4.41 (Ubuntu) Server at www.glancier.co.zw Port 443</address>\n"
SERVER_SOFTWARE
"Apache/2.4.41 (Ubuntu)"
SERVER_NAME
"www.glancier.co.zw"
SERVER_ADDR
"146.190.24.146"
SERVER_PORT
"443"
REMOTE_ADDR
"18.206.160.129"
DOCUMENT_ROOT
"/var/www/html/glancier.co.zw/"
REQUEST_SCHEME
"https"
CONTEXT_PREFIX
""
CONTEXT_DOCUMENT_ROOT
"/var/www/html/glancier.co.zw/"
SERVER_ADMIN
"atmarombedza@gmail.com"
SCRIPT_FILENAME
"/var/www/html/glancier.co.zw/index.php"
REMOTE_PORT
"60574"
REDIRECT_URL
"/details/solar_farm_project"
GATEWAY_INTERFACE
"CGI/1.1"
SERVER_PROTOCOL
"HTTP/1.1"
REQUEST_METHOD
"GET"
QUERY_STRING
""
REQUEST_URI
"/details/solar_farm_project"
SCRIPT_NAME
"/index.php"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1711648412.864
REQUEST_TIME
1711648412
empty
0. Whoops\Handler\PrettyPageHandler