Tables are orders orders_id | order_date | is_accepted | min_amount_charges | delivery_charges 1 | 2024-12-10 10:05:49 | 1 | 5 | 3 2 | 2024-12-10 10:06:49 | 1 | 5 | 2 orders_products orders_products_id | products_id | orders_id | final_price | qty | products_name 1 | 1 | 1 | 4 | 1 | products 1 2 | 2 | 1 | 5 | 2 | products 2 3 | 1 | 2 | 8 | 2 | products 1 4 | 2 | 2 | 2.5 | 1 | products 2 orders_products_options orders_products_options_id | order_product_options_id (pk of orders_products_id) | products_id | orders_id | products_options_price 1 | 1 | 1 | 1 | 3 2 | 1 | 1 | 1 | 0 3 | 1 | 1 | 1 | 2 4 | 2 | 2 | 1 | 2 5 | 3 | 1 | 2 | 3 6 | 3 | 1 | 2 | 0 7 | 4 | 1 | 2 | 2 8 | 4 | 2 | 2 | 2 order_additional_charges Id | orders_id | charges_name | charges_amount 1 | 1 | service charges | 6 2 | 1 | other charges | 4 3 | 2 | service charges | 4 tax_analysis Amount | tax_type | taxable_amount | orders_id 4 | excluded | 5 | 1 2 | excluded | 5 | 1 3 | excluded | 5 | 2 4 | excluded | 5 | 2 4 | included | 5 | 2 //ignore orders_status_history orders_id | orders_status_id | created_at 1 | 1 | 2024-12-10 10:04:28 1 | 2 | 2024-12-10 10:04:29 1 | 3 | 2024-12-10 10:06:28 2 | 2 | 2024-12-10 10:06:29 orders_status orders_status_id | orders_status_name 1 | order 2 | pending 3 | cooking 4 | cancelled I want to get the following results with respect to the following logic - Filter record by between given dates orders.order_date - Order shouldn't be cancelled - order.is_accepted = 1 results should show products_name | qty , Total value (final_price + products_options_price) products 1 | 3 | 12 + 10 = 22 products 2 | 3 | 7.5 + 4 = 11.4 Extra charges = sum of all orders with respect to the given date filters tax analysis table Amount + delivery charges of all order with respect to the given date filters sum of all products total value with respect to the given date filters = 22+ 11.4 = 23.4 using laravel if same product is ordered in other orders then qty and price will be increased all data should be grouped by products name and sum of other charges like sum of all orders delivery_charges + sum all order additional table charges + sum of all excluded taxes = other charges add at the end of records and total of all Total Prices sum of all products of all orders + sum of all orders other charges using laravel