let's say i have this table in database...
So i want to search from specific data, for example
- i want to search from all schedules where
station_id
is equal1
so I did it like this...
$schedule = DB::table('schedules')
->where('station_id', 1)
->where('schedule_number', 'like', '%'.$query.'%')
->orWhere('route_name', 'like', '%'.$query.'%')
->orWhere('user_first', 'like', '%'.$query.'%')
->orWhere('id', 'like', '%'.$query.'%')
->orWhere('created_at', 'like', '%'.$query.'%')
->get();
But this will search from all schedules
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire