stepanenko3 / nova-settings

This Laravel Nova settings tool based on env, using nativ nova fields and resources
MIT License
31 stars 5 forks source link

settings(): Return value must be of type string, array returned #15

Open didiatworkz opened 5 months ago

didiatworkz commented 5 months ago

Hello, I updated today the to the version 1.1.0 and nothing works anymore 😉

The nova backend show only empty values and on the frontend I get the error message: settings(): Return value must be of type string, array returned

I guess that happens because the settings function want a string return value https://github.com/stepanenko3/nova-settings/commit/b0d0ba0fca3c3e4f8bbc7c94df4913e74769f077#diff-7827dcf8c28ba9d97397f03b4ca75c132540f5c377e253fbc47ef064a373ce73R11

The thing is, that I created now a new class with only text fields and can't get these value as well 😞 dd(settings('test'));

<?php

namespace App\Nova\Settings;

use Laravel\Nova\Fields\Text;
use Stepanenko3\NovaSettings\Types\AbstractType;

class Test extends AbstractType
{
    public function fields(): array
    {
        return [
            Text::make('This is a test', 'test_value'),
        ];
    }
}

Currently, I'm downgraded to version 1.0.7 and everything work as aspected. Best didiatworkz

stepanenko3 commented 5 months ago

Hi, @didiatworkz

Fixed in https://github.com/stepanenko3/nova-settings/releases/tag/v1.1.1

didiatworkz commented 5 months ago

Nothing has been changed, really :/