App\Http\Controllers\BlogController::index PHP Method

index() public method

Get all posts and make pagination.
public index ( ) : Illuminate\Http\Response
return Illuminate\Http\Response
    public function index()
    {
        $posts = $this->blog->all(setting('post_per_page'));
        $links = $posts->links();
        return compact('posts', 'links');
    }