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>
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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community