View composers are called later, so they will overwrite keys set before.
You could check if value exists, and add default values only if they doesn't.
Cleanest way to accomplish this would be (off the top of my head):
Still, it seems to be wrong... But will do what you want
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community