2016-08-27 32 views
0

FatalErrorException:語法錯誤,意外 ')',希望 '(' Laravel語法錯誤,在第35行不工作

查看產品百貨

</section> 
    <hr/> 
    <table class="table table-paper table-condensed table-bordered"> 
     <thead> 
     <tr> 
      <th>#</th> 
      <th>@lang('viewproductlocations.Product Name')</th> 
      <th>Department Name</th> 
      <th>Quantity</th> 
      <th>Created At</th> 
      <th>@lang('viewproductlocations.Updated At')</th> 

     </tr> 
     </thead> 
     <tbody> 

     <?php $i = 1; ?> 
     @foreach ($productsInDepartments as $productsInDepartment) 
      <tr class=""> 
      <th scope="row">{{$i}}</th> 
      @foreach ($productsInDepartment->present()->groupAndSumUpProductsInDepartments as departmentProduct) 

       <td>{{$departmentProduct->product->productName}}</td> 
       <td>{{$departmentProduct->totalAmount}}</td> 
       @endforeach 

         <td> 
          {{$productsInDepartment->name}} 
         </td> 

         <td>{{Carbon::parse($productsInDepartment->created_at)->format('d/m/Y')}} </td> 
         <td>{{Carbon::parse($productsInDepartment->updated_at)->format('d/m/Y')}} </td> 
       <?php $i++; ?> 
      </tr> 
     @endforeach 

     </tbody> 
    </table> 
@endsection 

我收到此錯誤,請幫助我得到一個語法錯誤。致命錯誤異常

回答

0

我能解決我的問題。我不得不循環,雖然我得到的結果是一個列表和語法錯誤來自我離開了其他人的臉

0

請發表fullCode並強調行35. 但我認爲你應該檢查這部分

@foreach ($productsInDepartment->present()->groupAndSumUpProductsInDepartments as departmentProduct) 

嘗試加入 - >獲得()

@foreach ($productsInDepartment->present()->groupAndSumUpProductsInDepartments->get() as departmentProduct)