2

I'm using backpack in my project. I’ve created a customized fields that is dropdown and select box. In one blade file I’m displaying two fields based on dropdown selection I’ll display the options for select box. So everything is working fine somehow Edit and update is working for these customized field. any idea how to achieve this? Thanks in advance

In one blade file I've written these two customized fields code. so based on dropdown selection I'll pull up the options for next select box. Tried to override existed backpack files for this model. but no luck.

  'label' => "Professors",
  'type' => "selectProfessors",
  'name' => 'professor_id',
  'entity' => 'professor',
  'attribute' => "name",
  'model' => Professor::class,
  'options' => (function ($query) {
   return $query->where('professor_id', '=', backpack_user()
     ->professor_id)
     ->get();
  }),

It is not working only for edit and update. for creating and deleting working as expected.

deepu
  • 107
  • 3
  • 10
  • Can't really help since it's a custom field type and the code isn't here. But I suspect that in your selectProfessors.blade.php file, you haven't treated loading the old entries. Do the correct entries get populated, when the Edit form is loaded? – tabacitu Jul 17 '19 at 10:46
  • Thanks @tabacitu I got it. – deepu Jul 17 '19 at 16:48

0 Answers0