Hi,
Currently I have 4 different files for each card (first quarter...fourth quarter)
This is my code for FirstQuarterText.php (I created four different files with similar query. different is in the WHERE clause QUARTER(register_date)
`
class FirstQuarterText extends SimpleCard
{
protected function onCreated()
{
$this
->type("warning")
->text("First Quarter")
->icon("fa fa-battery-three-quarters");
}
protected function value()
{
return myDatabase::rawSQL("
SELECT COUNT(id)
FROM student
WHERE QUARTER(register_date) = 1
")->run()->getScalar();
}
}
`
This code from Dashboard.php
Row::create([
FirstQuarterText::create()->width(1/4),
SecondQuarterText::create()->width(1/4),
ThirdQuarterText::create()->width(1/4),
FourthQuarterText::create()->width(1/4),
]),
Is it possible for me to use just a single file OR single query that can display in 4 different card/chart
SELECT COUNT(id), QUARTER(register_date)
FROM student
WHERE QUARTER(register_date) = 1
GROUP BY QUARTER(register_date)