@foreach($user->getAttributes() as $attribute => $value)
Title: {{ $attribute }} value: {{ $value }}<br>
@endforeach
Или в модели
public $titles = [
'attribute_name' => 'Attribute Name',
'attribute' => 'Corespond Title',
................
];
public function getTitle($attribute)
{
return $this->titles[$attribute] ?? title_case($attribute);
}
Использование
@foreach($user->getAttributes() as $attribute => $value)
Title: {{ $user->getTitle($attribute) }} value: {{ $value }}<br>
@endforeach
Также можно сделать это в файлах lang в resources / lang / en make attribute.php
[
'attribute_name' => 'Attribute Name',
'attribute' => 'Corespond Title',
]
Использование
@foreach($user->getAttributes() as $attribute => $value)
Title: {{ __('attributes.'. $attribute) }} value: {{ $value }}<br>
@endforeach