I have a shared form that I am using to save or update a post record. I am using optional($post)->postimage
to check if this variable exists in case of update (because I must display it to let users delete if they want it). I added a new column which is in hasOne relationship with my main model I am saving data. I get this error:
Maximum function nesting level of '256' reached, aborting!
and laravel is targeting the line where I have
@if (optional($post)->postimage != null)
...
If I comment this line, my form works perfect as before. But I don't want it like that, because there are existing posts and I want to let users add this data if they want it, like they can add to new record. I have many existing other relations on my model, including hasOne before the new one I added. What is the problem? what am I doing wrong? How to fix this ? thanks
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire