Hi,
just getting started and the first view is making me have second thoughts about Laravel...
I have a query which returns three rows (I echoed the sql and run it my self) but when I do a @foreach on the result it loops far too many times (22!)
And I can't use the loop variable for showing the result, when I try I get an "Undefined property" error no matter what I write :(
Changing $ex to $book will make the view work and returns 22 rows, when the sql returns one. When I chose another id I will still get 22 loops even though that sql returns 3 rows
I don't even see how your code works at all. You never actually execute the query to get $books in your controller. You do for $info (which is one book). You're also missing quotes in places
Also, what version of laravel are you using? You have @stop in your template. I believe that was deprecated with version 5, and replaced with @endsection
You can build on the query builder instance up until you execute it. I just put the common parts of the query first, and added the where clause to it separately, and then executed the query with ->get() after everything was put together.