alexa
Facebook
Twitter
LinkedIn
Instagram
Whatsapp
Call Now
Quick Inquiry

where could i be wrong? Trying to get property 'title' of non-object in laravel

where could i be wrong? Trying to get property 'title' of non-object in laravel
 public function theblog(Request $req, $slug){ $blog = blog::find($slug);
dd($slug); 
 DB::table("blogs")->where('slug', "$slug")->increment('views'); return view('myblog',compact('blog')); } 

Check if there is value for $blog...if it is null(that is the problem) then you should check you DB?


223 0
7

Write a Comments


* Be the first to Make Comment

GoodFirms Badge
GoodFirms Badge

Fix Your Meeting With Our SEO Consultants in India To Grow Your Business Online