這里的代碼: $search = request()->get('search'); $conciergerieSelect = request()->get('conciergerie'); $services = Service::get(); $available = 'Disponible'; $prestations = Prestation::with([ 'service:name' ]) ->whereHas('item', function ($query) use ($available) { $query->where('status', $available); }) ->whereIn('conciergerie_ids', [$conciergerieSelect]) ->where('name', 'regexp', "/$search/i") ->get(); $prestationsArrayIds = []; foreach($prestations as $prestation) { array_push($prestationsArrayIds, $prestation['_id']); } // dd($prestationsArrayIds); is okay i get 200 status $items = Item::orderBy('name') ->get(); // Here if i do dd($items); it's okay i get 200 status return $result = [ 'items' => $items ];問題是如果我返回 $result 來像這里一樣測試 $items ,我會收到 500 錯誤。你有想法嗎 ?謝謝你。
- 3 回答
- 0 關(guān)注
- 114 瀏覽
添加回答
舉報
0/150
提交
取消