stefan7
115
3
Laravel

@php in foreach

Posted 1 month ago by stefan7

Hi, any idea why the $url-variable in between of @php is not working?

Exception: Trying to get property 'content' of non-object

               @foreach($position->url as $url)
                    @php
                        $content = $url->content;
                    @endphp
                @endforeach

Please sign in or create an account to participate in this conversation.