I just learning laravel and got this error
calling array on route class using foreach but i got error (undefined index)
CodePudding user response:
You're using the wrong variable within the foreach scope.
use $post["title"]
instead of $posts["title"]
// @foreach ($posts as $post)
$posts: entire array
$post: an item of array
CodePudding user response:
There is spelling mistake you should use
$post["title"] not $posts["title"]