laravel / nova-issues

553 stars 34 forks source link

select fileds Dynamic options return empty. #6312

Closed guoxiangke closed 7 months ago

guoxiangke commented 7 months ago

Laravel v10.48.2 (PHP v8.2.6)

Description:

tinker works.

image

but not work for nova! Select::make(__('Lts First Paly'), 'lts_first_play')->options(\App\Models\LyMeta::getLtsOptions($this->code))->onlyOnForms(),

here is the function in the mode, I changed to static function and pass the $code instead of $this->code. neither work. But I am sure before it works when I finished the function.

public static function getLtsOptions($code){
        $tags = self::getLtsTags($code);
        $options = LtsMeta::withAnyTags($tags, 'lts')->get()->pluck('name','id')->toArray();
        return $options;
    }

Thanks.

guoxiangke commented 7 months ago
image image image