gpt4 book ai didi

filament select with two columns(带两个柱子的细丝选择)

转载 作者:bug小助手 更新时间:2023-10-24 18:44:12 25 4
gpt4 key购买 nike



How could you configure the filament select component so that I get the first and last name?

您如何配置灯丝选择组件,以便我获得名字和姓氏?


    public static function form(Form $form): Form
{
return $form
->schema([
Select::make('customer_id')
->relationship('customer', 'name')
->searchable(['name', 'surname'])
->preload()
->required()
->createOptionForm([
TextInput::make('name')
->required()
->label('Nombre'),
TextInput::make('surname')
->required(),
TextInput::make('lastname')
->label('Last Name')
]),
]);
}

I tried with an array but it doesn't work

我尝试使用数组,但不起作用


->relationship('customer', ['name', 'lastname'])

->关系(‘Customer’,[‘name’,‘Lastname’])


更多回答

->relationship('customer', \DB::raw("CONCAT(name, ' ', lastname) as full_name"))

->Relationship(‘Customer’,\DB::RAW(“Concat(name,‘’,lastname)as Full_Name”))

优秀答案推荐
更多回答

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com