I'm just practicing at the moment and just wondering if someone can point me in the right direction.
Why would this return a blank page if no results are found, if i put an item in the database it returns the item.
Route::get('/read', function (){
$posts = Post::all();
if(empty($posts)) {
echo "No Posts Exist";
} else {
foreach ($posts as $post) {
return $post->title;
}
}
});