如何在laravel中获取多个数据

时间:2019-01-18 20:56:06

标签: php laravel

这是控制器即时消息错误,此集合实例上不存在属性[{$ key}]。

public function showcustom($id)
        {

            $custompack = CustomPackages::find($id);
            $venue = Venue::find($custompack->venue);

            $food = Food::all();
            $attire = Attire::all();
            $hairmakeup = HairMakeup::all();
            $invitation = Invitation::all();
            $photosvideos = PhotosVideos::all();
            $cakescupcakes = CakesCupcakes::all();
            $lightsound = LightSound::all();
            $programhost = ProgramHost::all();
            $eventsingers = EventSingers::all();
            //$custompack = CustomPackages::all();

            return view('packages.customshow',compact('venue','custompack','packages','food','attire','hairmakeup','photosvideos','cakescupcakes','lightsound','programhost','eventsingers','invitation'));
}

1 个答案:

答案 0 :(得分:0)

请检查您通过的Venue::find(integer_expected)场地是否为整数。