Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
尝试读取“属性”;名称“;在数组上(视图:C:\xampp\htdocs\Testing\resources\views\product.blade.php)_Php_Laravel - Fatal编程技术网

尝试读取“属性”;名称“;在数组上(视图:C:\xampp\htdocs\Testing\resources\views\product.blade.php)

尝试读取“属性”;名称“;在数组上(视图:C:\xampp\htdocs\Testing\resources\views\product.blade.php),php,laravel,Php,Laravel,我是拉拉维尔的初学者,当我把统计表放在刀刃上时,我得到了这个警告 尝试读取数组上的属性“name”(视图:C:\xampp\htdocs\Testing\resources\views\product.blade.php) 这是控制器 public function index() { $response = Http::get('https://api.lazada.co.id/rest/products/get?filter=live&app_key=100132&

我是拉拉维尔的初学者,当我把统计表放在刀刃上时,我得到了这个警告

尝试读取数组上的属性“name”(视图:C:\xampp\htdocs\Testing\resources\views\product.blade.php)

这是控制器

  public function index()
{
    $response = Http::get('https://api.lazada.co.id/rest/products/get?filter=live&app_key=100132&sign_method=sha256&timestamp=1612318435886&access_token=50000801006o5nrcA5192d1f9ag1FHQBUqffCEyCmrXDohvhzExSkczUnnxJ4y&sign=F31584775544970D59AB58EC4B1B77933BC2D32401E33C1D2D5095690C31627C');
    $data = $response->json();
    return view('product',compact ('data'));
}
这是我的看法

    @extends('layout/main')

@section ('title', 'Testing Laravel')
@section ('container')

<div class="container">
        <div class="row">
        <div class="col-10">
        <h1 class="mt-3">List Product </h1>
        <table class="table">
        <thead class="thead-dark">
        <tr>
        <th scope="col">#</th>
        <th scope="col">Name</th>
        <th scope="col">Desc</th>
        <th scope="col">Brand</th>
        <th scope="col">Clothing Material</th>
        <th scope="col">Leather Material</th>
        </tr>
         </thead>
         <tbody> 
         @foreach ($data as $datas)
         <tr>
         <th scope="row">1</th>
         <td>{{$datas->name}}</td>
         <td>{{$datas-description}}</td>
         <td>{{$datas->brand}}<td>
         <td>{{$datas->clothing_material}}</td>
         <td>{{$datas->leather_material}}</td>
         </tr>
         @endforeach
          </tbody>
        </table>
        </div>
        </div>
        </div>
 
   @endsection
@extends('layout/main'))
@章节(‘标题’、‘测试拉拉维尔’)
@节(“容器”)
列表产品
#
名称
描述
烙印
服装面料
皮革材料
@foreach($data作为$datas)
1.
{{$datas->name}
{{$datas description}}
{{$datas->brand}
{{$datas->服装材料}
{{$datas->皮革材料}
@endforeach
@端部
像这样在循环中使用-

     {{ $data['name'] }}
     {{ $datas['description'] }}

欢迎来到苏。。。您的错误消息非常清楚
尝试读取数组上的属性“name”