Replies: 1 comment
-
I like the idea of a warning if reserved variables are overwritten. Throwing an exception would probably break too many existing projects though where people don't intend to use the reserved variable. Mavbe the exception handler for views could add a notice to the actual exception message, don't know how feasible that would be though. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Thought this was a livewire issue but apperantly this could be improved in laravel itself.
I was trying to output validation errors for a variable which worked without any problems in another component.
But was rather confused when I got the error:
when doing a simple
Reason behind that is the fact, that inside my
render()
method I did this:So I unintentionally overwrote the
$errors
variable in the view which is present by default.My proposed solution would be to throw an exception if variables are passed on to the
view()
method if they contain keys which are known, reservered variables for default functionality.Beta Was this translation helpful? Give feedback.
All reactions