Working with Datatables and other collections

Posted 8 months ago by Aron-Spiess

I need some help with returning more than just the datatables data, I'd like to return results from two other sql queries.

// normal way to call back the datatable
        return DataTables::of($comments_list)
            ->rawColumns(['title'] ,['comment'] ,['created_by'] ,['comment_date'])
// normal way to call back sql query collections
return view('dashboard.commentslist', compact('owners','admins'));

I assume I can add the compact('owners','admins')); but when I try to reference these in my blade I get an undefined variable

I'm not looking to use the data with my datatable more so just on the blade where the datatable displays

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

Reply to

Use Markdown with GitHub-flavored code blocks.