我用这种方式为我的网站做了一个分页,但我仍然收到错误!我试图解决,我搜索了很多,没有找到解决方案.我希望你能帮助我.
控制器 –
class ContentController extends MasterController { public function content() { $content = content::all()->paginate(10); $content->setPath('content'); //Customise Page Url return view('content.boot',compact('content')); } }
查看 –
@extends('master') @section('content') @if(count($content) > 0 ) @foreach($content as $row) <video width="330" controls> <source src="{{ asset('videos/' . $row['video'] )}}" type="video/mp4"> </video> @endforeach @endif {!! $content->render() !!} @endsection
路线 –
Route::get('/','ContentController@content');
错误 –
BadMethodCallException in Macroable.PHP line 81:
Method paginate does not exist.