In this tutorial I’m going to describe how to solve Parameter must be an array or an object that implements countable view:

1 st step:- Go to your Controller -> PostController

and change this code

$posts = Post::all();
return view(‘posts.index’)->with(‘posts’, ‘$posts’);

2nd step use compact method copy this code and simply paste it code would be work 100%

$posts = Post::all();
return view(‘posts.index’,compact(‘posts’));

After using this code is worked

Thanks ….🙏🙏

--

--

--

Hi I am Amit Experienced Web Developer with a demonstrated history of working in the information technology and services industry.

Love podcasts or audiobooks? Learn on the go with our new app.

Do You Wanna Be Our Partner ? -Blokfield.INC

Graphing Time Series Data through Unity

Have you heard about the $BOV launching today on @uniswap & @0xPolygon .

An advanced guide to migrate from LastPass to Bitwarden

Ibis: A Python Data Analysis Framework for Development and Production

An alternative way to ElasticSearch

3D TO 2D Set-Up

Spark Your Learning

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Amit Kumar

Amit Kumar

Hi I am Amit Experienced Web Developer with a demonstrated history of working in the information technology and services industry.

More from Medium

Installing Homebrew without admin privileges

Custom LMS Development for Enhanced Performance and Learning

How to Send an Email in PHP (OOP)

Object Calisthenics applied to PHP