Skip to main content

Requirements

Before installing Laravel List, ensure your environment meets these requirements:

PHP Version

PHP 8.3 or higher is required for type hints and modern language features.

Laravel Version

Laravel 11.x or 12.x is supported. Works with both versions seamlessly.

Installation via Composer

1

Install the package

Run the following command in your Laravel project root:
composer require derheyne/laravel-list
This will install the package and its dependencies.
2

Verify installation

Check that the package is installed correctly:
composer show derheyne/laravel-list
You should see the package details and version information.
3

Start using ListCollection

Import and use the ListCollection class in your code:
use dhy\LaravelList\ListCollection;

$list = new ListCollection([1, 2, 3]);
No additional configuration is needed!

That’s It!

Unlike many Laravel packages, Laravel List requires no configuration, no migrations, and no service provider registration. It works out of the box.
Laravel List is a simple, focused package that provides a single class: ListCollection. There are no config files to publish, no migrations to run, and no views to customize.

What Gets Installed

When you install Laravel List, you get:
  • ListCollection class: The main collection wrapper in the dhy\LaravelList namespace
  • Full type support: Complete PHPStan type annotations for IDE autocompletion
  • Laravel integration: Seamless integration with Laravel’s collection ecosystem

Dependencies

Laravel List has minimal dependencies:
{
  "php": "^8.3",
  "illuminate/contracts": "^11.0||^12.0",
  "illuminate/collections": "^11.0||^12.0"
}
These are typically already installed in your Laravel application.

Upgrading

To upgrade to the latest version of Laravel List:
composer update derheyne/laravel-list
Check the changelog for information about new features and breaking changes between versions.

Compatibility Matrix

Laravel ListPHP VersionLaravel Version
1.x8.3+11.x, 12.x

Troubleshooting

If you see an error about PHP version requirements:
Your PHP version (8.2.x) does not satisfy that requirement.
Solution: Upgrade to PHP 8.3 or higher. Laravel List uses modern PHP features like typed properties and union types that require PHP 8.3+.
If you see dependency conflicts with Laravel:
Your requirements could not be resolved to an installable set of packages.
Solution: Ensure you’re using Laravel 11.x or 12.x. Earlier versions are not supported.
If Composer runs out of memory during installation:
PHP Fatal error: Allowed memory size exhausted
Solution: Increase PHP’s memory limit temporarily:
php -d memory_limit=-1 $(which composer) require derheyne/laravel-list

Next Steps

Quickstart Guide

Now that you’ve installed Laravel List, follow the quickstart guide to learn the basics and create your first ListCollection.

Build docs developers (and LLMs) love