I don't understand why is it not working i neither see any errors nor any progress. Somebody please help what i am missing in my code. I already put @livewireStyles in head and @livewireScripts in script section but search functionality is not working..
<?php
namespace App\Livewire;
use App\Models\Booking;
use Livewire\Component;
class SearchUsers extends Component
{
public $searchTerm;
public $bookings;
public function render()
{
$searchTerm = '%' . $this->searchTerm . '%';
$this->bookings = Booking::where('pickup', 'like', $searchTerm)->get();
return view('livewire.search-users');
}
}
<input wire:model="searchTerm" type="text" placeholder="Search users..">
@php($sl = 1)
@forelse($bookings as $booking)
<tr>
<td>{{$sl++}}</td>
<td>{{$booking->user->name}}</td>
<td>{{$booking->icabbi_trip_id}}</td>
<td>{{$booking->date}}</td>
<td>{{ Carbon\Carbon::createFromFormat('H:i:s', $booking->time)->format('h:i A') }}</td>
<td>{{$booking->pickup}}</td>
<td>{{$booking->destination}}</td>
<td>{{$booking->seats}}</td>
<td>{{str_replace(' ', '-', ucwords(str_replace('-', ' ', strtolower($booking->type))))}}</td>
<td>{{$booking->status}}</td>
<td>{{Carbon\Carbon::parse($booking->updated_at)->format('h:i A')}}</td>
<td>{{$booking->cancellation_reason}}</td>
</tr>
@empty
<tr>
<td>No bookings available</td>
</tr>
@endforelse