mrperfectionist
1 week ago

UnexpectedValueException in Laravel 6

Posted 1 week ago by mrperfectionist
The Response content must be a string or object implementing __toString(), "object" given.
$category = DB::table('categories')->where('category_id', $id)->first();
return $category;

When I am giving get() then it is giving solution. But why first() is giving this error?

Please sign in or create an account to participate in this conversation.