Answer the question
In order to leave comments, you need to log in
What causes the "Trying to get property of non-object" error?
Laravel.
$test = Tests::first();
return $test->name;
$test = Tests::where('category_id','=',$category_id)->first();
return $test->name;
Answer the question
In order to leave comments, you need to log in
Apparently, there is no such category, respectively, there is no object and its properties, which is what the error text says
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question