get all data eloquent laravel 1

get all data eloquent laravel

Blog::all();

//example usage.
$posts = Blog::all();

Here is what the above code is Doing:
1. We’re using the Blog model to get all the posts from the database.
2. We’re storing the result in a variable called $posts.
3. We’re using the all() method to get all the posts.

Similar Posts