Support the ongoing development of Laravel.io →
Database Blade Forms
Last updated 2 years ago.
0

You could do something like this (labels.php lang file)...

return array(
    'id' => ':modelName ID',
    'name' => ':modelName Name',
);

And then insert that modelName in your views...

<tr>
    <td>{{ trans('labels.id', array('modelName' => $modelName)) }}</td>
    <td>{{ trans('labels.name', array('modelName' => $modelName)) }}</td>
    <td>{{ trans('labels.category', array('modelName' => $categoryModelName)) }}</td>
<tr>
    <td>{{ $product->product_id }}
    <td>{{ $product->product_name }}</td>
    <td>{{ $product->category->category_name }}</td>
</tr>
Last updated 2 years ago.
0

Thanks for this suggestions.

I also thought about model specific language files like product.php and category.php so the fields id and name are unique.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.