I use laravel and prefer to build the data myself (with eloquent Models) rather than retrieve the query and ask the report to build it.
I am confused about dataSource/dataSources/dataStore property/method. How can I add the Array to the report class in the setup method. I expect something similar to:
function setup()
{
$data = Device::where('customer','1')->get()->toArray();
$this->dataSources('billable', $data);
//or maybe
$this->dataStore('billable')->pipe($data);
}
I have seen the following in a report.view.php sample, but would like to pass the $data to the report.view.php from the class, not write it directly in the view:
$data = array(
array("category"=>"Books","sale"=>32000,"cost"=>20000,"profit"=>12000),
);
Table::create(array(
"dataSource"=>$data
));
Thx