Support the ongoing development of →
posted 7 years ago
Last updated 1 year ago.

You can't pass data from view to view. Every view is associated with a controller. you need to make a call to the next view's controller. My suggestion would be to spend half a day watching tutorials on you tube so that you can understand the concepts.


Thanks sbasi5576. I've actually been through quite a few videos at this stage. I get the concept of controllers and I'm already using them to get JSON data from my API as I mentioned above. The problem is that if I make a call to the next view's controller I'm going to (as far as I understand it) have to get the data all over again which is not efficient. I'm trying to figure how to get a subset of the data I already have in my view to the next view i.e. the detail view.


Write the content to a hidden div and unhide it onclick


softwaredeveloperca said:

Write the content to a hidden div and unhide it onclick

that doesn't follow with my UI flow unfortunately. There is a slew of data needed on the detail view which wouldn't suit showing it 'inline' and with multiple properties the weight of the page might be bigger than I'd like. I had thought Laravel might have a strategy for persisting data between views. Had a look at composers but that's not a good fit for me. For the moment I'll probably just pull the individual property info from the API using a new controller and then look at other ways to store the property data, maybe JSON stringify the data to localStorage, not sure. Anyway, thanks softwaredeveloperca, I'll pass anything 'Laravel'-ian to the forum if I find a good fix,



There is the possibility to pass data from view to view via @include.

@include('your_view', [ "foo" => "bar"])

And in the view your_view you now have access to $foo.


You could cache the data ?


Sign in to participate in this thread!


Your banner here too?

Wittner wittner Joined 12 Jan 2017


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.