i need to run laravel query to get all customers with max date in booking details and if the customer has no booking detaisl i get customer with null date value i tried below query i tried below query
$allcustomers=Customer::
leftjoin('bookingdts','bookingdts.customer_id','=','customers.id' )
->groupBy('customers.id')
->selectRaw('customers.*,max(bookingdts.date) as maxdate')
->get();
but i get the below error
SQLSTATE[42000]: Syntax error or access violation: 1055 'elwady.customers.name' isn't in GROUP BY