Livewire
Anyone can help me passing data into view with livewire? I have a resumes.index and I need to pass data from 2 tables.
17 Replies
Can you share some code to show what you've been trying?
I have 2 tables educations and experiences.
I tried to use 2 foreach but the output is not what I want
I think this looks ok... passing the collections to the view and then looping over with a foreach. What is the issue?
I need to pass the experience too
Should just be available as $experiences
Just like $educations is available
Here is my goal.
So you want to merge the two?
Yeah, it is possible ?
Yes, but this isn’t a livewire issue and you’ll need to look up a proper way to use eloquent to join them together coming out of the db, especially if you want to group them by years.
Honestly, I’m not sure of the best way to achieve that with two separate models. But I know it’s possible.
@einnlleinhatt_ Is this a very long page with a lot of items or just a few education + experience combined?
Is there a need to even have these as records in the db.? Personally, I would do the whole section as a rich text and just style it with css.
Its a long page with few sections.
Good point. Or even a use a Repeater field with a "type" sub-field (education vs. experience) for each item.
That could work too.
I’m seeing it in Tiptap editor as just details that could be styled and even collapsible. 🙂
The reason I'm asking is because it could be easier to combine the items in plain PHP, instead of in the DB. If you don't have thousands and thousands of line items, it should be quite fast and simple code. Does that make sense?
But there could be a reason for the delineation, but I’m not seeing it in the screenshot.
I see, thankyou for the feedback.