PHPackages                             srph/laravel-collection-shallow-to-array - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. srph/laravel-collection-shallow-to-array

AbandonedLibrary

srph/laravel-collection-shallow-to-array
========================================

Apply a shallow toArray to a Collection

v0.1.0(10y ago)015MITPHPPHP &gt;=5.5.9

Since Jan 5Pushed 10y ago1 watchersCompare

[ Source](https://github.com/srph/laravel-collection-shallow-to-array)[ Packagist](https://packagist.org/packages/srph/laravel-collection-shallow-to-array)[ RSS](/packages/srph-laravel-collection-shallow-to-array/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

laravel-collection-shallow-to-array
===================================

[](#laravel-collection-shallow-to-array)

[![Build Status](https://camo.githubusercontent.com/5bcc19544a9d899cb83eda4b4efe57c676b6994af657c0033f1ba134f488a8bd/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f737270682f6c61726176656c2d636f6c6c656374696f6e2d7368616c6c6f772d746f2d61727261792e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/srph/laravel-collection-shallow-to-array?branch=master) [![Latest Stable Version](https://camo.githubusercontent.com/76ebdb55c5a2aaa24e3030aac8bf9842438edf8e189848464ebd693379b71542/68747470733a2f2f706f7365722e707567782e6f72672f737270682f6c61726176656c2d636f6c6c656374696f6e2d7368616c6c6f772d746f2d61727261792f762f737461626c65)](https://packagist.org/packages/srph/laravel-collection-shallow-to-array) [![Total Downloads](https://camo.githubusercontent.com/a5482bac439d833652832d5f909e931bf4b16fa4d3680d31a63f0c5e9f3cf3ff/68747470733a2f2f706f7365722e707567782e6f72672f737270682f6c61726176656c2d636f6c6c656374696f6e2d7368616c6c6f772d746f2d61727261792f646f776e6c6f616473)](https://packagist.org/packages/srph/laravel-collection-shallow-to-array) [![Latest Unstable Version](https://camo.githubusercontent.com/7a943d2b7e2d907dbf9e960ed297f4a10335cf57fe1e29ce53bfcd8811e809f2/68747470733a2f2f706f7365722e707567782e6f72672f737270682f6c61726176656c2d636f6c6c656374696f6e2d7368616c6c6f772d746f2d61727261792f762f756e737461626c65)](https://packagist.org/packages/srph/laravel-collection-shallow-to-array) [![License](https://camo.githubusercontent.com/98baa6969670e8f0c7f5946527265cef208e63b14fdbea9d21d6380ddb7f4bbb/68747470733a2f2f706f7365722e707567782e6f72672f737270682f6c61726176656c2d636f6c6c656374696f6e2d7368616c6c6f772d746f2d61727261792f6c6963656e7365)](https://packagist.org/packages/srph/laravel-collection-shallow-to-array)

Apply a shallow `toArray` to a `Collection`.

Deprecation Notice
------------------

[](#deprecation-notice)

Use [`Collection#all`](https://laravel.com/api/5.2/Illuminate/Support/Collection.html#method_all) instead. This utility doesn't make any sense; created out of author's laziness to read the API Documentation.

Huh?
----

[](#huh)

Calling `toArray` of a `Collection` with Eloquent models (e.g., `User::all()`) also applies `toArray` to each item in the collection. Here's a comparison with `Collection toArray`:

```
- User::all()->toArray(); // [[], [] []];
+ collection_shallow_to_array(User::all()); // [User, User, User]
```

Installing
----------

[](#installing)

```
composer require srph/laravel-collection-shallow-to-array
```

Usage
-----

[](#usage)

```
$users = Users::all();
$array = collection_shallow_to_array($users);
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3780d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c6418b04ec2d5f377b9de0359c587e73637a8799d8e5a496263f7f307c0db81?d=identicon)[srph](/maintainers/srph)

---

Top Contributors

[![srph](https://avatars.githubusercontent.com/u/5093058?v=4)](https://github.com/srph "srph (12 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/srph-laravel-collection-shallow-to-array/health.svg)

```
[![Health](https://phpackages.com/badges/srph-laravel-collection-shallow-to-array/health.svg)](https://phpackages.com/packages/srph-laravel-collection-shallow-to-array)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
