fix: update public tour functionality
This commit is contained in:
@@ -75,4 +75,16 @@ class Tour extends Model
|
||||
->withPivot('id')
|
||||
->withTimestamps();
|
||||
}
|
||||
protected static function booted()
|
||||
{
|
||||
static::creating(function ($tour) {
|
||||
// اگر مقداری تعیین نشده بود، پیشفرضها را اعمال کن
|
||||
if (is_null($tour->views_count)) {
|
||||
$tour->views_count = 0;
|
||||
}
|
||||
if (is_null($tour->status)) {
|
||||
$tour->status = 0; // فرض بر اینکه 0 یعنی غیرفعال/پیشنویس
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,70 @@
|
||||
@props(['tour'])
|
||||
<div class="banner _h-33vh _br-3 banner-animate banner-animate-mask-in">
|
||||
|
||||
<div class="card tour-card">
|
||||
<a href="{{ route('tours.show', $tour) }}">
|
||||
<img src="{{ $tour->images->first()->path ?? asset('images/placeholder.jpg') }}" class="card-img-top"
|
||||
alt="{{ $tour->title }}">
|
||||
<div
|
||||
class="banner-bg"
|
||||
style="background-image:url('{{ asset($tour->image) }}');">
|
||||
</div>
|
||||
|
||||
<div class="banner-mask"></div>
|
||||
|
||||
<a
|
||||
class="banner-link"
|
||||
href="{{ route('tours.show', $tour) }}">
|
||||
</a>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">
|
||||
<a href="{{ route('tours.show', $tour) }}">{{ $tour->title }}</a>
|
||||
|
||||
<div class="banner-caption _pt-120 banner-caption-bottom banner-caption-grad">
|
||||
|
||||
<h5 class="banner-title">
|
||||
{{ $tour->title }}
|
||||
</h5>
|
||||
<p class="card-text">{{ Str::limit($tour->description, 80) }}</p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<span>{{ $tour->travelType->title ?? '—' }}</span>
|
||||
<strong>{{ number_format($tour->price) }} تومان</strong>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{--<div class="banner _h-33vh _br-3 banner-animate banner-animate-mask-in">--}}
|
||||
|
||||
{{-- <div--}}
|
||||
{{-- class="banner-bg"--}}
|
||||
{{-- style="background-image:url('{{ asset($image) }}');">--}}
|
||||
{{-- </div>--}}
|
||||
|
||||
{{-- <div class="banner-mask"></div>--}}
|
||||
|
||||
{{-- <a--}}
|
||||
{{-- class="banner-link"--}}
|
||||
{{-- href="#">--}}
|
||||
{{-- </a>--}}
|
||||
|
||||
{{-- <div class="banner-caption _pt-120 banner-caption-bottom banner-caption-grad">--}}
|
||||
|
||||
{{-- <h5 class="banner-title">--}}
|
||||
{{-- {{ $title }}--}}
|
||||
{{-- </h5>--}}
|
||||
|
||||
{{-- <p class="banner-subtitle">--}}
|
||||
{{-- {{ $country }}--}}
|
||||
{{-- </p>--}}
|
||||
|
||||
{{-- </div>--}}
|
||||
|
||||
{{--</div>--}}
|
||||
|
||||
{{--@props(['tour'])--}}
|
||||
|
||||
{{--<div class="card tour-card">--}}
|
||||
{{-- <a href="{{ route('tours.show', $tour) }}">--}}
|
||||
{{-- <img src="{{ $tour->images->first()->path ?? asset('images/placeholder.jpg') }}" class="card-img-top"--}}
|
||||
{{-- alt="{{ $tour->title }}">--}}
|
||||
{{-- </a>--}}
|
||||
{{-- <div class="card-body">--}}
|
||||
{{-- <h5 class="card-title">--}}
|
||||
{{-- <a href="{{ route('tours.show', $tour) }}">{{ $tour->title }}</a>--}}
|
||||
{{-- </h5>--}}
|
||||
{{-- <p class="card-text">{{ Str::limit($tour->description, 80) }}</p>--}}
|
||||
{{-- <div class="d-flex justify-content-between">--}}
|
||||
{{-- <span>{{ $tour->travelType->title ?? '—' }}</span>--}}
|
||||
{{-- <strong>{{ number_format($tour->price) }} تومان</strong>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div>--}}
|
||||
{{--</div>--}}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user