feat(favorites): make images dynamic in user favorites section
This commit is contained in:
@@ -42,9 +42,15 @@
|
||||
<div class="hotel-item h-100 d-flex flex-column justify-content-between">
|
||||
<div class="hotel-img position-relative">
|
||||
<span class="badge bg-info position-absolute top-0 start-0 m-2">تور</span>
|
||||
<img src="{{ $favorite->tour->file ? asset($favorite->tour->file->path) : asset('assets/img/tour/default.jpg') }}"
|
||||
alt="{{ $favorite->tour->title }}"
|
||||
style="height: 200px; width: 100%; object-fit: cover;">
|
||||
@if($favorite->tour->coverImage?->file)
|
||||
<img src="{{ getFileUrl($tour->coverImage->file_id) }}"
|
||||
class="w-100 h-100"
|
||||
alt="{{ $favorite->tour->title }}">
|
||||
@else
|
||||
<img src="{{ asset('assets/admin/images/faces/DefaultAvatar.jpg') }}"
|
||||
class="w-100 h-100"
|
||||
alt="{{ $favorite->tour->title }}">
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('accounts.favorites.tour.toggle', $favorite->tour->id) }}" class="d-inline">
|
||||
@csrf
|
||||
@@ -88,9 +94,15 @@
|
||||
<div class="hotel-item h-100 d-flex flex-column justify-content-between">
|
||||
<div class="hotel-img position-relative">
|
||||
<span class="badge bg-primary position-absolute top-0 start-0 m-2">پرواز</span>
|
||||
<img src="{{ $favorite->flight->file ? asset($favorite->flight->file->path) : asset('assets/img/flight/default.jpg') }}"
|
||||
alt="{{ $favorite->flight->flight_number }}"
|
||||
style="height: 200px; width: 100%; object-fit: cover;">
|
||||
@if($favorite->flight->coverImage?->file_id)
|
||||
<img src="{{ getFileUrl($favorite->flight->coverImage->file_id) }}"
|
||||
class="w-100 h-100"
|
||||
alt="{{ $favorite->flight->flight_number }}">
|
||||
@else
|
||||
<img src="{{ asset('assets/img/account/user.jpg') }}"
|
||||
class="w-100 h-100"
|
||||
alt="{{ $favorite->flight->title }}">
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('accounts.favorites.flight.toggle', $favorite->flight->id) }}" class="d-inline">
|
||||
@csrf
|
||||
|
||||
Reference in New Issue
Block a user