public static function set_form_fields($form, $instance = null)So you use either one of them, depending on what you need in the dropdown.
{
// call the parent to create the fieldset
parent::set_form_fields($form, $instance);
// get the options for brand using a DB query if you need all of them
$options = \DB::select('id', 'name')->from('brands')->execute()->as_array('id', 'name');
// or use ORM access if you only need related items
$options = \Arr::assoc_to_keyval($this->brands, 'id', 'name');
// set the options on the brand_id field
$form->field('brand_id')->set_options($options);
}
It looks like you're new here. If you want to get involved, click one of these buttons!