我使用这种方式为我的网站制作分页,但仍然出现错误!我尝试解决并进行了大量搜索,但没有找到解决方案。希望你能帮助我。
控制器 -
控制器 -
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');
错误 -
在 Macroable.php 文件的第 81 行中出现了 BadMethodCallException 异常:
方法 paginate 不存在。