Abdifatah
1 month ago
205
3
Laravel

Laravel Excel Export Model with Relationship

Posted 1 month ago by Abdifatah

This code only returns the Job Model only.


public function collection()
    {
        $jobs = Job::with("work")->get();
        return $jobs;
    }

I need each model rows with their corresponding child rows to appear inside it , just like nested table.

Please sign in or create an account to participate in this conversation.