fix(homepage): menyesuaikan relasi attachment menjadi attachments user di halaman homepage
This commit is contained in:
parent
f064f4da8f
commit
917310d8a0
@ -15,7 +15,7 @@ public function index(): View
|
||||
'pageTitle' => 'Beranda',
|
||||
'metaDesc' => 'Temukan barbershop dengan kualitas layanan unggulan, pengalaman profesional, dan suasana nyaman. Dapatkan penawaran menarik dan ulasan terpercaya untuk memilih layanan yang sesuai dengan kebutuhan Anda',
|
||||
'services' => Service::latest()->take(3)->get(),
|
||||
'barber' => User::with(['biography', 'attachment'])->get(),
|
||||
'barber' => User::with(['biography', 'attachments'])->barber()->get(),
|
||||
'prices' => Service::latest()->get(),
|
||||
]);
|
||||
}
|
||||
|
||||
@ -141,7 +141,7 @@
|
||||
<div class="col-xl-4 col-lg-4 col-md-6 col-sm-">
|
||||
<div class="single-team mb-80 text-center">
|
||||
<div class="team-img">
|
||||
<img src="{{ Storage::url("users/{$item->attachment->formatted_attachment}") }}"
|
||||
<img src="{{ optional($item->attachments()->where('type', 'avatar')->first())->formatted_attachment ? Storage::url('users/' . optional($item->attachments()->where('type', 'avatar')->first())->formatted_attachment) : '' }}"
|
||||
alt="image">
|
||||
</div>
|
||||
<div class="team-caption">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user