Support the ongoing development of Laravel.io →
Blade Forms Laravel
0

Hello relume,

You could utilize Laravel Blade Components to create a reusable view component.

For example, you could make a Blade component for an item in a list and pass the data like this:

<x-item :title="$title" :description="$description" />

When it comes to the variation problem, you could create a specialize set of item component and logic to further fits your needs. For example:

<x-item-user :name="$name" :contact="$contact" />

<x-item-product :title="$title" :price="$price" />

I don't know if its considered best practices or not, but it says much about how I would approach the situation. Hope it helps.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

André Müller relume Joined 30 Aug 2024

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.