Json 我发送给带有响应的视图的变量为空

Json 我发送给带有响应的视图的变量为空,json,laravel-5,view,controller,response,Json,Laravel 5,View,Controller,Response,我正在通过查询从控制器中的数据库检索数据,并尝试使用response->json将其发送到view,但是view da控制台看起来是空的{} 控制器 public function hamleler($mac_id,$turnuva_sporcu_id){ $notations=array(); $notations=Notasyon::select('id','beyaz_hamle')- >where('mac_id',$mac_id)->where(

我正在通过查询从控制器中的数据库检索数据,并尝试使用response->json将其发送到view,但是view da控制台看起来是空的{}

控制器

 public function hamleler($mac_id,$turnuva_sporcu_id){

    $notations=array();
    $notations=Notasyon::select('id','beyaz_hamle')- 
   >where('mac_id',$mac_id)->where('turnuva_sporcu_id',$turnuva_sporcu_id)
        ->orderby('id','desc')
        ->first();
        //->pluck('beyaz_hamle');
    return response()->json($notations);
   }
坎利刀片

 $.get("{{URL::To('/{turnuva_sporcu_id}/{mac_id}/canli-yayin/hamleler')}}", function(data1) {
     if(data1) {
               console.log(data1);
             }
                else {
                alert('error');
                }

                 });
控制台屏幕中的数据

尝试在控制器中打印$notations值,以检查您是否从模型中获得任何结果

dd($notations): 这将打印从Notasyon模型检索到的结果


还要检查Notasyon的拼写…可能是Notasyon…我想..

我检查了,我看到了这个输出'Notasyon{202▼ #表:“notasyon”#connection:“mysql”#primaryKey:“id”#keyType:“int”+递增:true#with:[]#with:[]#withCount:[]#perPage:15+exists:true+wasnrecentlycreated:false#属性:数组:2[▶] #原件:阵列:2[▶] #更改:[]#强制转换:[]#日期:[]#日期格式:null#附件:[]#dispatchesEvents:[]#可观察对象:[]#关系:[]#接触:[]+时间戳:true#hidden:[]#可见:[]#可填充:[]#受保护:数组:1[▶] }`