This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

strk
strk

Is there a way to export models json column with backends integrated import/export functionality?

Thanks

Last updated

strk
strk

here is what I have come up with for now

public function exportData($columns, $sessionKey = null)
{

    $cats = Cats::all();

    $data = array();

    foreach($cats as $cat) {

        // $cat->data is json column

        foreach ($cat->data as $value) {

            $data[] = [
                'name' => $value['name'],
                'bread' => $value['bread'],
            ];

        }

    }

    return $data;
}

Last updated

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.