2017 © Pedro Peláez
 

library laravel-collection-shallow-to-array

Apply a shallow toArray to a Collection

image

srph/laravel-collection-shallow-to-array

Apply a shallow toArray to a Collection

  • Thursday, January 14, 2016
  • by srph
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 33 % Grown

The README.md

laravel-collection-shallow-to-array

Build Status Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Apply a shallow toArray to a Collection., (*2)

Deprecation Notice

Use Collection#all instead. This utility doesn't make any sense; created out of author's laziness to read the API Documentation., (*3)

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:, (*4)

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

Installing

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

Usage

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

The Versions

14/01 2016

dev-master

9999999-dev

Apply a shallow toArray to a Collection

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

by Avatar srph

05/01 2016

v0.1.0

0.1.0.0

Apply a shallow toArray to a Collection

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

by Avatar srph