首页 > 解决方案 > Voyager dropdown relationship ajax call

问题描述

How i can override model query which populate a belongsto relationship dropdown via ajax call. Tha call is like http://santinisacri.local/admin/santini-soggetti/relation?type=santini_soggetti_hasone_santini_soggetti_relationship&method=add&page=1 and the response is a JSON. I want to add a where clausole. I have tried in model but nothing. I need to create a new controller?

标签: ajaxlaravelrelationshipdropdownvoyager

解决方案


我通过一个覆盖控制器解决并返回一个数组,如:

$results['results'] = $soggetti;
return $results;

推荐阅读