php - Showing only Boolean 1 as published in laravel 8
Solution:
You only forgot to execute the query:
$posts = Post::where('is_active', '1')->get();
Answer
Solution:
try instead string '1' to 1
public function index()
{
$posts = Post::where('is_active', 1)->get();
return view('pages/home', compact('posts'));
}
Answer
Solution:
I Solved it, i have to put the query in return view as an array
return view('posts.index', ['posts' => $posts = Post::where('is_active', '1')->get(), 'myField' => $myField, 'keywords' => $keywords, 'descriptions' => $descriptions]);
Thankyou for all your helped..
Source