feat: Add functions to retrieve previous and upcoming events; update events template to display dynamic event data

This commit is contained in:
2025-08-22 11:15:13 +05:45
parent 711ae9caf9
commit 31bea937c4
3 changed files with 61 additions and 189 deletions

View File

@@ -22,101 +22,25 @@
<div class="swiper swiper-events mt-40 mb-40">
<div class="swiper-wrapper">
<a href="" class="swiper-slide">
<div class="event-block relative w-full">
<div class="w-full rounded-30">
<img src="{{ asset('raffles/assets/images/general/event1.jfif') }}" alt="">
</div>
<div class="flex items-center gap-20 py-20 px-20 bg-white rounded-30">
<div>
<h4 class="text-16 text-ter">Apr</h4>
<h4 class="text-18 font-bold text-black">14</h4>
@foreach ($upcomingEvents as $event)
<a href="" class="swiper-slide">
<div class="event-block relative w-full">
<div class="w-full rounded-30">
<img src="{{ asset($event->image) }}" alt="">
</div>
<div>
<h3 class="text-16 text-black">Free ilets Class: Raffles Educare Associates</h3>
<p class="text-14 p-0 m-0 text-grey">Join the free ilets Classes </p>
<p class="text-14 text-grey">Starting from 5 pm - 7 pm </p>
<div class="flex items-center gap-20 py-20 px-20 bg-white rounded-30">
<div>
<h4 class="text-16 text-ter">Start</h4>
<h4 class="text-18 font-bold text-black">{{ $event->start_date }}</h4>
</div>
<div>
<h3 class="text-16 text-black">{{ $event->title }}</h3>
<p class="text-14 p-0 m-0 text-grey">{{ $event->short_description }} </p>
</div>
</div>
</div>
</div>
</a>
<a href="" class="swiper-slide">
<div class="event-block relative w-full">
<div class="w-full rounded-30">
<img src="{{ asset('raffles/assets/images/general/event1.jfif') }}" alt="">
</div>
<div class="flex items-center gap-20 py-20 px-20 bg-white rounded-30">
<div>
<h4 class="text-16 text-ter">Apr</h4>
<h4 class="text-18 font-bold text-black">14</h4>
</div>
<div>
<h3 class="text-16 text-black">Free ilets Class: Raffles Educare Associates</h3>
<p class="text-14 p-0 m-0 text-grey">Join the free ilets Classes </p>
<p class="text-14 text-grey">Starting from 5 pm - 7 pm </p>
</div>
</div>
</div>
</a>
<a href="" class="swiper-slide">
<div class="event-block relative w-full">
<div class="w-full rounded-30">
<img src="{{ asset('raffles/assets/images/general/event1.jfif') }}" alt="">
</div>
<div class="flex items-center gap-20 py-20 px-20 bg-white rounded-30">
<div>
<h4 class="text-16 text-ter">Apr</h4>
<h4 class="text-18 font-bold text-black">14</h4>
</div>
<div>
<h3 class="text-16 text-black">Free ilets Class: Raffles Educare Associates</h3>
<p class="text-14 p-0 m-0 text-grey">Join the free ilets Classes </p>
<p class="text-14 text-grey">Starting from 5 pm - 7 pm </p>
</div>
</div>
</div>
</a>
<a href="" class="swiper-slide">
<div class="event-block relative w-full">
<div class="w-full rounded-30">
<img src="{{ asset('raffles/assets/images/general/event1.jfif') }}" alt="">
</div>
<div class="flex items-center gap-20 py-20 px-20 bg-white rounded-30">
<div>
<h4 class="text-16 text-ter">Apr</h4>
<h4 class="text-18 font-bold text-black">14</h4>
</div>
<div>
<h3 class="text-16 text-black">Free ilets Class: Raffles Educare Associates</h3>
<p class="text-14 p-0 m-0 text-grey">Join the free ilets Classes </p>
<p class="text-14 text-grey">Starting from 5 pm - 7 pm </p>
</div>
</div>
</div>
</a>
<a href="" class="swiper-slide">
<div class="event-block relative w-full">
<div class="w-full rounded-30">
<img src="{{ asset('raffles/assets/images/general/event1.jfif') }}" alt="">
</div>
<div class="flex items-center gap-20 py-20 px-20 bg-white rounded-30">
<div>
<h4 class="text-16 text-ter">Apr</h4>
<h4 class="text-18 font-bold text-black">14</h4>
</div>
<div>
<h3 class="text-16 text-black">Free ilets Class: Raffles Educare Associates</h3>
<p class="text-14 p-0 m-0 text-grey">Join the free ilets Classes </p>
<p class="text-14 text-grey">Starting from 5 pm - 7 pm </p>
</div>
</div>
</div>
</a>
</a>
@endforeach
</div>
<!-- Pagination -->
<!-- <div class="swiper-pagination"></div> -->
@@ -137,102 +61,27 @@
<div class="swiper swiper-events mt-40">
<div class="swiper-wrapper">
<a href="" class="swiper-slide">
<div class="event-block relative w-full">
<div class="w-full rounded-30">
<img src="{{ asset('raffles/assets/images/general/event1.jfif') }}" alt="">
</div>
<div class="flex items-center gap-20 py-20 px-20 bg-white rounded-30">
<div>
<h4 class="text-16 text-ter">Apr</h4>
<h4 class="text-18 font-bold text-black">14</h4>
@foreach ($upcomingEvents as $event)
<a href="" class="swiper-slide">
<div class="event-block relative w-full">
<div class="w-full rounded-30">
<img src="{{ asset($event->image) }}" alt="">
</div>
<div>
<h3 class="text-16 text-black">Free ilets Class: Raffles Educare Associates</h3>
<p class="text-14 p-0 m-0 text-grey">Join the free ilets Classes </p>
<p class="text-14 text-grey">Starting from 5 pm - 7 pm </p>
<div class="flex items-center gap-20 py-20 px-20 bg-white rounded-30">
<div>
<h4 class="text-16 text-ter">Start</h4>
<h4 class="text-18 font-bold text-black">{{ $event->start_date }}</h4>
</div>
<div>
<h3 class="text-16 text-black">{{ $event->title }}</h3>
<p class="text-14 p-0 m-0 text-grey">{{ $event->short_description }} </p>
</div>
</div>
</div>
</div>
</a>
</a>
@endforeach
<a href="" class="swiper-slide">
<div class="event-block relative w-full">
<div class="w-full rounded-30">
<img src="{{ asset('raffles/assets/images/general/event1.jfif') }}" alt="">
</div>
<div class="flex items-center gap-20 py-20 px-20 bg-white rounded-30">
<div>
<h4 class="text-16 text-ter">Apr</h4>
<h4 class="text-18 font-bold text-black">14</h4>
</div>
<div>
<h3 class="text-16 text-black">Free ilets Class: Raffles Educare Associates</h3>
<p class="text-14 p-0 m-0 text-grey">Join the free ilets Classes </p>
<p class="text-14 text-grey">Starting from 5 pm - 7 pm </p>
</div>
</div>
</div>
</a>
<a href="" class="swiper-slide">
<div class="event-block relative w-full">
<div class="w-full rounded-30">
<img src="{{ asset('raffles/assets/images/general/event1.jfif') }}" alt="">
</div>
<div class="flex items-center gap-20 py-20 px-20 bg-white rounded-30">
<div>
<h4 class="text-16 text-ter">Apr</h4>
<h4 class="text-18 font-bold text-black">14</h4>
</div>
<div>
<h3 class="text-16 text-black">Free ilets Class: Raffles Educare Associates</h3>
<p class="text-14 p-0 m-0 text-grey">Join the free ilets Classes </p>
<p class="text-14 text-grey">Starting from 5 pm - 7 pm </p>
</div>
</div>
</div>
</a>
<a href="" class="swiper-slide">
<div class="event-block relative w-full">
<div class="w-full rounded-30">
<img src="{{ asset('raffles/assets/images/general/event1.jfif') }}" alt="">
</div>
<div class="flex items-center gap-20 py-20 px-20 bg-white rounded-30">
<div>
<h4 class="text-16 text-ter">Apr</h4>
<h4 class="text-18 font-bold text-black">14</h4>
</div>
<div>
<h3 class="text-16 text-black">Free ilets Class: Raffles Educare Associates</h3>
<p class="text-14 p-0 m-0 text-grey">Join the free ilets Classes </p>
<p class="text-14 text-grey">Starting from 5 pm - 7 pm </p>
</div>
</div>
</div>
</a>
<a href="" class="swiper-slide">
<div class="event-block relative w-full">
<div class="w-full rounded-30">
<img src="{{ asset('raffles/assets/images/general/event1.jfif') }}" alt="">
</div>
<div class="flex items-center gap-20 py-20 px-20 bg-white rounded-30">
<div>
<h4 class="text-16 text-ter">Apr</h4>
<h4 class="text-18 font-bold text-black">14</h4>
</div>
<div>
<h3 class="text-16 text-black">Free ilets Class: Raffles Educare Associates</h3>
<p class="text-14 p-0 m-0 text-grey">Join the free ilets Classes </p>
<p class="text-14 text-grey">Starting from 5 pm - 7 pm </p>
</div>
</div>
</div>
</a>
</div>
<!-- Pagination -->
<!-- <div class="swiper-pagination"></div> -->
@@ -280,12 +129,6 @@
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
</div>
{{-- <div class="flex justify-center items-center ">
<button class="text-center bg-white text-ter rounded-30 text-14">Load More</button>
</div> --}}
</div>
@endsection