KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

How to use with eloquent class joining table in report view how to access the columns #2802

Open Sabeena opened this topic on on Aug 21, 2022 - 1 comments

Sabeena commented on Aug 21, 2022
function setup()
    {
        //Now you can use Eloquent inside query() like you normally do
        $this->src("elo")->query(
            RegisterRecord::with([
            'register:id,name', 'user:id,name',
            'closedByUser:id,name', 'location:id,name'])
        )->pipe($this->dataStore("registers"));
"dataSource"=>$this->dataStore("registers"),
            "columns"=>array(

how to specify users.name in columns array how to access it ?

KoolReport commented on Aug 22, 2022

Let do this:

<?php
echo json_encode(array_keys($this->dataStore("registers")->get(0)));
?>

You will get the list of available column names

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None