PHPackages                             theopeneyes/sort-associative-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. [API Development](/categories/api)
4. /
5. theopeneyes/sort-associative-array

ActiveLibrary[API Development](/categories/api)

theopeneyes/sort-associative-array
==================================

A Laravel package to sort associative array

1.0.0(4y ago)05MITPHP

Since Aug 4Pushed 4y ago1 watchersCompare

[ Source](https://github.com/uttambhut222/sort-associative-array)[ Packagist](https://packagist.org/packages/theopeneyes/sort-associative-array)[ RSS](/packages/theopeneyes-sort-associative-array/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

sort-associative-array
======================

[](#sort-associative-array)

A Laravel package to sort associative array.

Installation
------------

[](#installation)

To get started, install `require` in your project.

- Via Composer

```
 composer require theopeneyes/sort-associative-array
```

- Via composer.json file

Enter the following in the `require` section of your project `composer.json` file.

```
"theopeneyes/sort-associative-array": "dev-main",
```

Run the `composer update` to download the package.

```
 composer update
```

Basic Usage
-----------

[](#basic-usage)

Let's assume a scenario where we have a huge array like the one below and we need to sort it by a value contained in the array:

```
$student = array(
	array(
		'name' => array(
			'first_name' => 'Joann',
			'last_name' => 'Daly'
        	),
		'age' => 18,
		'grade' => 12,
		'birth_month' => 5
    	),
	array(
		'name' => array(
			'first_name' => 'Jaiden',
			'last_name' => 'Wolf'
		),
		'age' => 15,
		'grade' => 10,
		'birth_month' => 8
	),
	array(
		'name' => array(
			'first_name' => 'Lara',
			'last_name' => 'Flores'
		),
		'age' => 8,
		'grade' => 3,
		'birth_month' => 2
	)
);
```

- In case it's sort by 'age'

```
use TheOpenEyes\SortAssociativeArray\SortAssociativeArray;

SortAssociativeArray::column($student, 'age', SORT_DESC);

/* Parameters of 'column' method
    1. Array - The array you would like to sort by.
    2. Column name
    3. Sort Direction - Should be either SORT_ASC or SORT_DESC (Optional, Default is SORT_ASC)
*/
```

- In case it's sort by 'first\_name'

```
use TheOpenEyes\SortAssociativeArray\SortAssociativeArray;

SortAssociativeArray::columnWithChild($student, 'name', 'first_name', SORT_DESC);

/* Parameters of 'columnWithChild' method
    1. Array - The array you would like to sort by.
    2. Parent column name
    3. Child column name
    4. Sort Direction - Should be either SORT_ASC or SORT_DESC (Optional, Default is SORT_ASC)
*/
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

1741d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fedd937bec9f3a62fa0c5bb66ef90159404f8d27c60a78702fa13327537cf6ae?d=identicon)[uttambhut222](/maintainers/uttambhut222)

---

Top Contributors

[![uttambhut222](https://avatars.githubusercontent.com/u/39264925?v=4)](https://github.com/uttambhut222 "uttambhut222 (7 commits)")

---

Tags

apilaravelassociative arraysort arraysort associative array

### Embed Badge

![Health badge](/badges/theopeneyes-sort-associative-array/health.svg)

```
[![Health](https://phpackages.com/badges/theopeneyes-sort-associative-array/health.svg)](https://phpackages.com/packages/theopeneyes-sort-associative-array)
```

###  Alternatives

[joisarjignesh/bigbluebutton

BigBlueButton Server API Library for Laravel

162145.5k1](/packages/joisarjignesh-bigbluebutton)[d-scribe/laraquick

A collection of classes to be extended/used in laravel applications for quick development

371.8k1](/packages/d-scribe-laraquick)

PHPackages © 2026

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