Replies: 1 comment
-
You can use https://yajrabox.com/docs/laravel-datatables/12.0/response-with#query-closure to make a new query that was used by the package. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to get the total count of my table rows to use it in a chart. I follow the steps of Quick starter.
This is my code for controller
`class FacilityController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index(FacilityDataTable $dataTable)
{
$facilitesCount = EcommerceFacility::count();
$restaurantFacilitesCount = EcommerceFacility::where('type', FacilityTypeEnum::RESTAURANT->value)->count();
$shopFacilitesCount = EcommerceFacility::where('type', FacilityTypeEnum::SHOPE->value)->count();
`
the facilitesCount variable will trigger another query that already triggered by the package to get the total count. I want to get the same result from the package it self and not making another query.
need help for it.
Beta Was this translation helpful? Give feedback.
All reactions