0

Is there any way on Laravel backpack in relationship Pro field to not allow having the same instance twice as a children in a belongsToMany relationship.

example here

enter image description here

I can add the same POI twice.

I tried to look on the doc and check the field blade view, I didn't find any option to filter the dropdown list

toyota Supra
  • 3,181
  • 4
  • 15
  • 19
  • I'm not enormously familiar with Backpack's system, but its docs indicate it uses the Laravel validation system fairly heavily; you probably want to look into the `distinct` rule. – ceejayoz May 22 '23 at 13:25
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 23 '23 at 04:25
  • I finally resolves my issue. To be more precise, the issue was that in Poi selection list, Pois that are already added to the list had to be ignored from the dropdown. As Backpack relationship field doesn't support this by default. The fetch method used to get POI need to be implemented by end. Backpack support got back to me with an answer and I could post an example of my fix in [there github forum : https://github.com/Laravel-Backpack/community-forum/discussions/498](https://github.com/Laravel-Backpack/community-forum/discussions/498) – user2811569 May 23 '23 at 12:32

0 Answers0