Laravel 4 - Trying to get property of non-object

后端 未结 2 1639
别那么骄傲
别那么骄傲 2021-01-12 06:40

I have been working with Laravel 4.1 to create a book list app with user relationships. I have the user relationships working however when I added the pagination I get the

2条回答
  •  时光说笑
    2021-01-12 06:49

    Try output gettype($book), if you get null in any point

    {{$book['image']}} //will not complain about it but gives output ""
    {{$book->image}} //will complain about it and throws an exception
    

    I think that's the reason

    I'm using laravel5 but I think it is the same with laravel4

提交回复
热议问题