vendredi 7 décembre 2018

why i can't call name from table food?

public function orderlist(Request $request){ $id = $request->id;

    $data['order'] = Order::where('shop_id',$id)->orderBy('id')->get();
            foreach($data['order'] as $orders){
                $orders->shop = Shop::where('id',$orders->shop_id)->first();
                $orders->food = Food::where('id',$orders->food_id)->get();
            }   
            return $orders->food->name;
    return view ('administrator.users.list_order.index',$data);
}



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2ElimbB
via IFTTT

Aucun commentaire:

Enregistrer un commentaire