Das Problem ist eine überzählige öffnende [ in dieser Zeile:
->where([['DATE(shipping_table.sold_date)', '=',$date, ['shipping_table.shipping_status', '=' ,1]])Schreibe sie wie folgt um. Wickle MySQL-Funktionen in DB::raw(), damit der Query Builder sie als rohe Ausdrücke behandelt:
$date = date("Y-m-d", strtotime($request->datepicker2)); $products = DB::table('shipping_table') ->select('products.product_name', 'products.price', DB::raw("Sum(shipping_products.quantity) as qtysold"), 'shipping_table.sold_date') ->join('shipping_products','shipping_table.shipping_id', '=', 'shipping_products.shipping_id') ->join('products','products.product_id', '=', 'shipping_products.product_id') ->where([[DB::raw("date(shipping_table.sold_date)"),$date], ['shipping_table.shipping_status', '=' ,1]]) ->groupBy('products.product_name') ->paginate(8);Ein Hinweis zum anderen Fehler, den du erhalten hast (Syntax error or access violation: 1055), der mit dem strengen ONLY_FULL_GROUP_BY-Modus von MySQL zusammenhängt. Diese Antwort erläutert die Lösung ausführlich: