Laravel分页错误 - 调用未定义的方法stdClass :: links()

Jis*_*had 2 mysql eloquent laravel-4 laravel-pagination

我开发了一个laravel应用程序,我想分页视图,

看看我的控制器.

$times=DB::table('timesheets')   
->leftJoin('users', 'timesheets.timesheet_user', '=', 'users.id')
->leftJoin('projects','projects.project_id','=','timesheets.timesheet_project_id')
->where('timesheet_user','=',$user)
->paginate(5);
return View::make('timesheet/index')->with('times',$times)->with('projects',$projects);
Run Code Online (Sandbox Code Playgroud)

在结果中获得结果,但是当我尝试显示链接时.它显示如下错误,

   Call to undefined method stdClass::links() 

 <?php echo $times->links(); ?> 
Run Code Online (Sandbox Code Playgroud)

我的代码中的错误是什么?

谢谢

Jis*_*had 6

它在我的模板文件中错了.

        <tbody>
          @foreach($qualdatas as $qualdata)
           <tr>
             <td>{{$qualdata->qualification_name}}</td>                
           </tr>
          @endforeach 
        </tbody>
       </table>
     {{$qualdatas->links()}}
Run Code Online (Sandbox Code Playgroud)

在我的模板文件中,foreach别名和数组名称相同.Thant是因为得到这样的错误.

当我将别名改为不同时,它的工作就像美丽一样.!