You can use toArray() of eloquent as below.

The toArray method converts the collection into a plain PHP array. If the collection's values are Eloquent models, the models will also be converted to arrays

$comments_collection = $post->comments()->get()->toArray()

From Laravel Docs:

toArray also converts all of the collection's nested objects that are an instance of Arrayable to an array. If you want to get the raw underlying array, use the all method instead.

Answer from Drudge Rajen on Stack Overflow
Discussions

Convert Array To Collection in Laravel - Stack Overflow
The toArray method converts the collection into a plain PHP array. More on stackoverflow.com
🌐 stackoverflow.com
Question: How to remove value from a collection
You can use the reject method $collection->reject(fn ($value) => $value == “alarms”)) This will return a new collection with all entries except alarms. Docs: https://laravel.com/docs/8.x/collections#method-reject More on reddit.com
🌐 r/laravel
5
0
April 10, 2021
How to convert array to Laravel Eloquent Collection.
You forgot the most important part, why are you turning it into an array in the first place? Why aren't you sorting the collection or the query? Have you gone through the collections documentation? http://laravel.com/docs/4.2/eloquent#collections More on reddit.com
🌐 r/laravel
4
1
January 26, 2015
How to fetch an object in a Laravel Collection and clear the fetched object's values
Seems like it should be $extract = $collection->fetch(2); More on reddit.com
🌐 r/laravel
4
2
December 30, 2014
🌐
Medium
medium.com › @albertcolom › use-custom-php-collection-instead-array-57700858cf1a
Use custom PHP Collection instead Array | by Albert Colom | Medium
December 11, 2024 - <?php declare(strict_types=1); namespace App\Context\Foo\Domain\Read\View\Foo; final readonly class Foo { public function __construct( public string $id, public string $name ) { } public function toArray(): return { return [ 'id' => $this->id, 'name' => $this->name, ]; } public function equals(self $other): bool { return $this->id === $other->id && $this->name === $other->name; } } Then can create a typed collection that contain a Foo inside
🌐
Code And Deploy
codeanddeploy.com › home › blog › laravel › laravel collection to array tutorial and example
Laravel Collection to Array Tutorial and Example
July 15, 2022 - As you can see we call the method toArray() so that it will return the array we want. public function index() { $collection = collect([ 'first_name' => 'Jose', 'last_name' => 'Dela Cruz', 'age' => 20, 'products' => [ [ 'id' => 1, 'name' => 'Product ...
🌐
GitHub
gist.github.com › aminusia › cb99a5e14289c2e85c077d92d6cd3f57
PHP Laravel convert collection to array with key and value from column · GitHub
PHP Laravel convert collection to array with key and value from column - gist:cb99a5e14289c2e85c077d92d6cd3f57
🌐
Stillat
stillat.com › blog › 2018 › 04 › 22 › laravel-5-collections-convert-a-collection-to-a-native-php-array-with-toarray
Laravel 5 Collections: Convert a Collection to a Native PHP Array With toArray » Stillat
The toArray method in Laravel's Collection class allows you to convert the collection into a plain PHP array. It not only returns the underlying array used by the collection, but also converts any object instance that implements the ...
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › php › php-dscollection-toarray-function
PHP | Ds\Collection toArray() Function - GeeksforGeeks
July 11, 2025 - The Ds\Collection::toArray() function is an inbuilt function in PHP which is used to converts the collections into array.
🌐
ItSolutionstuff
itsolutionstuff.com › post › how-to-convert-collection-to-array-in-laravelexample.html
How to Convert Collection to Array in Laravel? - ItSolutionstuff.com
November 5, 2023 - Example 1: Laravel Convert Collection to Array using all() you can see the simple controller file code: <?php · namespace App\Http\Controllers; use Illuminate\Http\Request; class UserController extends Controller · { /** * Display a listing of the resource.
🌐
Laravel
laravel.com › docs › 12.x › collections
Collections | Laravel 12.x - The clean stack for Artisans and agents
Laravel is a PHP web application framework with expressive, elegant syntax. We've already laid the foundation — freeing you to create without sweating the small things.
🌐
DEV Community
dev.to › codeofaccuracy › collection-vs-array-2e0n
Collection VS Array - DEV Community
March 27, 2023 - Collection VS Array & When To Use Which In Laravel, Arrays and Collections are both used for...
🌐
GitHub
gist.github.com › johnkary › 390d3ce10214a1eb45d9
Doctrine ArrayCollection ->toArray() usage modifies original array in collection · GitHub
Doctrine ArrayCollection ->toArray() usage modifies original array in collection - ArrayCollectionTest.php
🌐
DEV Community
dev.to › fahrenholz › collection-objects-in-php-1cbk
Collection objects in PHP - DEV Community
March 18, 2022 - One of the most important things to know about PHP is that it's loosely typed. Whereas in some cases this might offer you a plus of flexibility, it is often a problem. But, thankfully, there are ways to work around this implemented in the language. In this article, you'll learn how to build type-safe collection objects behaving exactly as arrays ...
🌐
Benjamin Crozat
benjamincrozat.com › home › blog › laravel collections: practical methods and examples
15 Laravel Collections tips to refactor your codebase
March 14, 2026 - $collection = collect([1, 2, 3]); $array = $collection->toArray(); This isn’t necessary most of the time, but it can come in handy. Collections work in foreach just like arrays.
🌐
Phpdox
phpdox.net › demo › Symfony2 › classes › Doctrine_Common_Collections_ArrayCollection.xhtml
phpDox - Doctrine\Common\Collections\ArrayCollection
slice() — Extract a slice of $length elements starting at position $offset from the Collection. toArray() — Gets the PHP array representation of this collection.