Skip to content

Call to undefined method addVisible #567

@WebVPF

Description

@WebVPF

Winter CMS Build

dev-develop

PHP Version

8.0

Database engine

MySQL/MariaDB

Plugins installed

custom

Issue description

Winter CMS - 1.2

When I try to export, I get an error:

"Call to undefined method WebVPF\Custom\Models\Item::addVisible()" on line 71 of www\vendor\laravel\framework\src\Illuminate\Support\Traits\ForwardsCalls.php

I do export according to the example from the official documentation https://wintercms.com/docs/backend/import-export#export-model

class SubscriberExport extends \Backend\Models\ExportModel
{
    public function exportData($columns, $sessionKey = null)
    {
        $subscribers = Subscriber::all();
        $subscribers->each(function($subscriber) use ($columns) {
            $subscriber->addVisible($columns);
        });
        return $subscribers->toArray();
    }
}

Steps to replicate

Export Implementation

Workaround

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions