I used this way to make a pagination for my site, but I still get an error! I tried to solve and I searched a lot, didn't find a solution. I hope you can help me.
Controller -
class ContentController extends MasterController {
public function content() {
$content = content::all()->paginate(10);
$content->setPath('content'); //Customise Page Url
return view('content.boot',compact('content'));
}
}
view -
@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 -
Route::get('/', 'ContentController@content');
Error -
BadMethodCallException in Macroable.php line 81:
Method paginate does not exist.