KoolReport's Forum

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

Laravel Relationship #2483

Open Mark Lordi opened this topic on on Dec 7, 2021 - 1 comments

Mark Lordi commented on Dec 7, 2021

Is there a way in the laravel eloquent integration to have the datasource array contain the relationship data if using a with clause? I have not found a way to do it currently. This is what I have in my setup function:

$this->src("elo")->query(
            Project_tasks::with('project')
                ->whereNotNull('ew_tid')
                ->orderBy('ew_tid', 'desc')
                ->whereNotNull('completed')
            )
            ->pipe($this->dataStore("tasks"));
Sebastian Morales commented on Dec 14, 2021

How about this with() clause?

    Project_tasks::with('project:id,task_id,project_name,project_detail')
    ...

Let us know if we understood your question correctly. Tks,

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
help needed

Laravel