2016-11-19 43 views
0

我得到解析錯誤:語法錯誤,意外的' - >'(T_OBJECT_OPERATOR),期待','或')'在我的視圖文件。這是我的控制器:laravel解析錯誤的觀點

public function gclogs() 
    { 
     $gclogs = DB::table('duplicategcs')->orderBy('created_at', 'desc')->paginate(20); 
     return view('admin.gclogs')->with('gclogs',$gclogs); 

    } 

而這僅僅是一個片段從視圖:

@foreach($gclogs as $gclog) 
          <tr> 
           <td> 
           {{gclog->id}} 
           </td> 
           <td> 
           {{gclog->user_id}} 
           </td> 
           <td> 
           {{gclog->google_id}} 
           </td> 
           <td> 
           {{gclog->google_email}} 
           </td> 
           <td> 
           {{gclog->created_at}} 
           </td> 
           <td> 
           <a href="{{url('admin/users/')}}/{{gclog->user_id}}">User Edit</a> 
           </td> 
          </tr> 

          @endforeach 
           </tbody> 
          </table> 
          <div align="center"> 
           {{ $gclogs->render() }} 
          </div> 
+0

你忘了很多的美元的跡象有.. – tkausl

+0

天上!是的,你是對的 –

回答

1

你忘了使用$裏面的foreach。

試試這個:

@foreach($gclogs as $gclog) 
<tr> 
    <td> 
    {{$gclog->id}} 
    </td> 
    <td> 
    {{$gclog->user_id}} 
    </td> 
    <td> 
    {{$gclog->google_id}} 
    </td> 
    <td> 
    {{$gclog->google_email}} 
    </td> 
    <td> 
    {{$gclog->created_at}} 
    </td> 
    <td> 
    <a href="{{url('admin/users/')}}/{{$gclog->user_id}}">User Edit</a> 
    </td> 
</tr> 

@endforeach 
    </tbody> 
</table> 
<div align="center"> 
    {{ $gclogs->render() }} 
</div> 
+0

謝謝老兄,當我看到它知道大聲笑xd –