Grammar::columnize() must be of the type array

Posted 2 weeks ago by shantodev

Hello

I am getting this error-

Grammar::columnize() must be of the type array

Here is my repository code-

class ShopRepositories{

    public function shopBankList($shopId, $fields = 'all')
    {
        return Shopbank::where('shop_id', $shopId)
            ->get( $fields == 'all' ? '*' : $fields );
    }
}

Here is how I call in my controller-

$shop_banks=  (new ShopRepositories())->shopBankList($shopId);

Can anyone help me why I am getting this error?

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

Reply to

Use Markdown with GitHub-flavored code blocks.