我正在使用laravel nova创建管理面板。这是我的代码。
Laravel新星资源
use Nova\Multiselect\Multiselect;
public function fields(Request $request)
{
return [
ID::make()->sortable(),
Multiselect::make(__('Day'),'day')
->options($this->getweedkDay()),
];
}
private function getweedkDay(){
$weekDay = [];
$weekDay[1] = __('Sunday');
$weekDay[2] = __('Monday');
$weekDay[3] = __('Tuesday');
$weekDay[4] = __('Wednesday');
$weekDay[5] = __('Thursday');
$weekDay[6] = __('Friday');
$weekDay[7] = __('Saturday');
return $weekDay;
}
我正在使用此plugin进行多重选择,并且日期字段是数据库中的varchar字段。问题是即使我可以选择项目并将其保存在数据库中,也无法在nova资源的编辑视图或索引视图中看到它们。有人可以帮助