我试图在select2类型字段中设置多个属性。 例如,我想将first_name和last_name显示为我的选择值的标签:
$this->crud->addField([ // Select
'label' => 'Employer',
'type' => 'select2',
'name' => 'employer_id', // the db column for the foreign key
'entity' => 'employer', // the method that defines the relationship in your Model
'attribute' => 'first_name', // foreign key attribute that is shown to user
'model' => 'App\Models\Employer' // foreign key model
], 'update/create/both');
有什么建议吗? 感谢。