@usamaahmed, please format your code.
Three backticks to open and three more to close...
``` // code block here ```
You may use Markdown with GitHub-flavored code blocks.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm creating events in my site. I want to search events on the basis of a country select dropdown . This is my blade file:
@include('/includes/header')
<div class="table-container">
<div class="container mx-w-lg">
<div class="users_data">
<div class="field">
<div class="label">{{ __('language.Country') }}</div>
<select name="country" id="country" required>
<option value="Netherlands" {{ session()->get('locale') == 'du' ? 'selected' : '' }}>{{ __('Netherlands') }}</option>
<option value="Spain" {{ session()->get('locale') == 'es' ? 'selected' : '' }}>{{ __('Spain') }}</option>
<option value="England" {{ session()->get('locale') == 'en' ? 'selected' : '' }}>{{ __('England') }}</option>
<option value="France" {{ session()->get('locale') == 'fr' ? 'selected' : '' }}>{{ __('France') }}</option>
<option value="Germany" {{ session()->get('locale') == 'gr' ? 'selected' : '' }}>{{ __('Germany') }}</option>
</select>
</div>
@foreach($Activities as $date => $Activity)
@if($date >= date('Y-m-d'))
@if($date === date('Y-m-d'))
<h3>{{ __('language.Today') }} {{date("d F Y", strtotime($date))}}</h3>
@elseif($date === $tomorrowDate)
<h3>{{ __('language.Tomorrow') }} {{date("d F Y", strtotime($date))}}</h3>
@else
<h3>{{date("l, d F Y", strtotime($date))}}</h3>
@endif
@endif
@foreach($Activity as $activity)
@if($activity->date >= date('Y-m-d'))
<div class="content">
<div class="item info">
@if(date_diff($activity->created_at, \Carbon\Carbon::now())->d < 1) <span>{{ __('language.New') }}!</span>
@endif
</div>
<div class="item img">
@include('activity::icon-component')
</div>
<div class="item title">
<a href="{{route("activity-detail", ['id' => $activity->id])}}"><span>{{ $activity->event_name }}</span></a>
</div>
<div class="item location">
<span><i class="fas fa-map-marker"></i> {{ $activity->location ?? 'Online' }}</span>
</div>
<div class="item time">
<span><i class="fas fa-clock"></i> {{ $activity->start_time }}</span>
</div>
<div class="item users">
<span><i class="fas fa-user"></i> {{ $activity->min_participants }} / {{ $activity->max_participants }}</span>
</div>
<div class="item">
<span>{{ $activity->age_group }} jr</span>
</div>
<div class="item">
<span>{{ \App\Models\User::find($activity->user_id)->name }}</span>
</div>
</div>
@endif
@endforeach
@endforeach
</div>
</div>
</div>
@include('/includes/footer')
and this is my function to search country:
$country= DB::table('activities')
->where('country', '=', $newdate)
->orderBy('id','asc')
->pluck('country'); // "5"
}
can anyone guide me how can I show columns of db on the base of select dropdown
Please or to participate in this conversation.