Please HELP ME, the query doesn't work JOIN and WHERE clause on the joined table's column
$filter->where(function ($query) {
$query->leftjoin('customers AS c', function($join){
$join->on('booking.customer_id', '=', 'c.id')
->where('c.first_name', 'like', "%{$this->input}%");
})->dump();
}, 'Customer has booking')->placeholder('search by first name Like');
Dump data :
"select * from `booking` left join `customers` as `c` on `booking`.`customer_id` = `c`.`id` and `c`.`first_name` like ?"
I tried to run on MySQL phpMyAdmin, it works, but the result on website response the same
@amun okay... never used this package. What exactly does it mean the query doesn't work JOIN and WHERE clause on the joined table's column; what is expected, and what are you actually getting???
@tykus i have 2 tables: Customer and Booking. A customer has many booking.
I want to query list of booking where the first name in customer table contain input keyword.
$grid->filter(function ($filter) {
$filter->where(function ($query) {
$query->join('customers AS c', function ($join) {
$join->on('booking.customer_id', '=', 'c.id')
->where('c.first_name', 'like', "%{$this->input}%");
})->dump();
}, 'Customer has booking')->placeholder('search by first name Like');
$filter->disableIdFilter();
});