attributes ?? null) ? $row->attributes : []; @endphp @foreach($languages as $lang) @php $translation = $translations[$lang->iso] ?? []; $translatedName = trim((string) data_get($translation, 'name', '')); @endphp {{ $translatedName !== '' ? $translatedName : 'N/A' }} @endforeach BLADE, [ 'languages' => collect([ (object) ['iso' => 'en', 'name' => 'English'], (object) ['iso' => 'sl', 'name' => 'Slovenian'], ]), 'row' => (object) [ 'attributes' => [ 'en' => ['name' => 'Hero title', 'content' => '

Hello

'], 'sl' => ['content' => '

Zivjo

'], ], ], ]); expect($html)->toContain('Hero title'); expect($html)->toContain('N/A'); });