PHPackages                             maniaba/asset-connect - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. maniaba/asset-connect

ActiveLibrary[File &amp; Storage](/categories/file-storage)

maniaba/asset-connect
=====================

AssetConnect is a file management library for CodeIgniter 4 that allows you to associate files with any entity in your application

v3.1.0(3w ago)1015.3k↑83.3%[1 PRs](https://github.com/maniaba/asset-connect/pulls)MITPHPPHP ^8.3CI passing

Since Dec 19Pushed 3w ago2 watchersCompare

[ Source](https://github.com/maniaba/asset-connect)[ Packagist](https://packagist.org/packages/maniaba/asset-connect)[ Docs](https://github.com/maniaba/asset-connect)[ RSS](/packages/maniaba-asset-connect/feed)WikiDiscussions develop Synced 3w ago

READMEChangelog (9)Dependencies (56)Versions (14)Used By (0)

AssetConnect for CodeIgniter 4
==============================

[](#assetconnect-for-codeigniter-4)

[![PHPUnit](https://github.com/maniaba/asset-connect/actions/workflows/phpunit.yml/badge.svg)](https://github.com/maniaba/asset-connect/actions/workflows/phpunit.yml)[![PHPStan](https://github.com/maniaba/asset-connect/actions/workflows/phpstan.yml/badge.svg)](https://github.com/maniaba/asset-connect/actions/workflows/phpstan.yml)[![Deptrac](https://github.com/maniaba/asset-connect/actions/workflows/deptrac.yml/badge.svg)](https://github.com/maniaba/asset-connect/actions/workflows/deptrac.yml)[![Psalm](https://github.com/maniaba/asset-connect/actions/workflows/psalm.yml/badge.svg)](https://github.com/maniaba/asset-connect/actions/workflows/psalm.yml)[![Docs](https://github.com/maniaba/asset-connect/actions/workflows/docs.yml/badge.svg)](https://github.com/maniaba/asset-connect/actions/workflows/docs.yml)[![Coverage Status](https://camo.githubusercontent.com/a4e2ae818ced878dfcf69e4422441a1e122c36656bb73031733ce48c5bb11696/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d616e696162612f61737365742d636f6e6e6563742f62616467652e7376673f6272616e63683d646576656c6f70)](https://coveralls.io/github/maniaba/asset-connect?branch=develop)

[![PHP](https://camo.githubusercontent.com/9d9ec35e438d32eee58734a510238e61050b48e92f67595cd0047b61f5ece336/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e332d626c7565)](https://camo.githubusercontent.com/9d9ec35e438d32eee58734a510238e61050b48e92f67595cd0047b61f5ece336/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e332d626c7565)[![CodeIgniter](https://camo.githubusercontent.com/14f84477742f9319323f384e501b25958c1f5fe98dd93b4b281003e6ec0ac2a5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f646549676e697465722d342e362b2d626c75652e7376673f7374796c653d666c61742d737175617265)](http://codeigniter.com/)[![License](https://camo.githubusercontent.com/d6bc2b26794002c24d023acaab01b6dbb953c57ab9cb80ba5b8aa2f2bd5de99a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c7565)](https://camo.githubusercontent.com/d6bc2b26794002c24d023acaab01b6dbb953c57ab9cb80ba5b8aa2f2bd5de99a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c7565)

AssetConnect is a file management library for CodeIgniter 4 that allows you to associate files with any entity in your application. It provides a robust, flexible solution for handling file uploads, storage, retrieval, variants, public custom metadata, backend-only internal metadata, and secure access control.

Storage is backed by named Flysystem disks. Asset records store the disk name and relative storage path, not absolute filesystem paths, so moving the application directory does not invalidate stored assets.

Features
--------

[](#features)

- Associate files with any CodeIgniter entity
- Organize files into typed asset collections
- Store files on named Flysystem disks, including local, S3-compatible, FTP, SFTP, Google Cloud Storage, Azure Blob Storage, WebDAV, memory, or custom adapters
- Generate public URLs from disk `public_url` configuration or serve protected assets through AssetConnect routes
- Generate variants inline or through CodeIgniter Queue
- Move existing assets between storage disks with `Asset::transferToStorage()`
- Process remote files through `copyToTemporaryFile()` and `withTemporaryFile()` when `local_path` is not available
- Keep public custom properties separate from backend-only internal properties
- Use pending assets for multi-step upload confirmation flows

Requirements
------------

[](#requirements)

- PHP 8.3 or higher
- CodeIgniter 4.6 or higher
- CodeIgniter Queue
- Flysystem 3

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

[](#installation)

Install the package:

```
composer require maniaba/asset-connect
```

Run the package migrations:

```
php spark migrate --namespace=Maniaba\\AssetConnect
```

If you use the default local public disk, expose it from `public/`:

```
php spark asset-connect:storage-link
```

Example Usage
-------------

[](#example-usage)

```
// Add an asset to a user
$asset = $user->addAsset('/path/to/file.jpg')
    ->withCustomProperties([
        'title' => 'Profile Picture',
        'description' => 'User profile picture'
    ])
    ->toAssetCollection(ImagesCollection::class);

// Get all assets for a user
$assets = $user->getAssets();

// Get assets from a specific collection
$images = $user->getAssets(ImagesCollection::class);

// Get the URL to an asset
$url = $user->getFirstAsset(ImagesCollection::class)->getUrl();

// Delete assets from a specific collection
$user->deleteAssets(ImagesCollection::class);
```

Storage Quick Start
-------------------

[](#storage-quick-start)

AssetConnect stores only `storage` and a storage-relative `path` in the database. Configure physical roots, visibility, and public URL prefixes in `Config\Asset`:

```
public string $defaultPublicStorage = 'public';
public string $defaultProtectedStorage = 'protected';

public array $storages = [
    'public' => [
        'driver'     => 'local',
        'root'       => WRITEPATH . 'asset-connect/public',
        'public_url' => 'assets/storage',
        'visibility' => 'public',
    ],
    'protected' => [
        'driver'     => 'local',
        'root'       => WRITEPATH . 'asset-connect/protected',
        'visibility' => 'protected',
    ],
];
```

Remote disks can be added through Flysystem adapters and storage-specific setup methods such as `setupStorageS3()`. Legacy driver-specific setup methods such as `setupStorageAwsS3()` are still supported as a fallback. Public remote disks should define an HTTP `public_url`; protected disks are served through AssetConnect routes and authorization.

For remote disks, `local_path` can be `null`. Use temporary-file helpers for processors that require a local filesystem path:

```
$asset->withTemporaryFile(static function (string $source): void {
    service('image')
        ->withFile($source)
        ->resize(1200, 900, true)
        ->save(WRITEPATH . 'cache/processed.jpg');
});
```

Move an existing asset and its variants to another configured disk:

```
$asset->transferToStorage('protected');
$asset->transferToStorage('s3_public', deleteSource: false);
```

Upgrade Guides
--------------

[](#upgrade-guides)

Version 2.1.0 resolves custom storage setup methods from the configured storage disk name first, with a legacy driver-based fallback.

Read the full guide when upgrading from 2.0.0: [Upgrade from 2.0.0 to 2.1.0](docs/upgrade-2.1.md).

Version 2.0.0 changes storage from filesystem-root paths to named storage disks.

Read the full guide before migrating production data: [Upgrade from 1.0.2 to 2.0.0](docs/upgrade-2.0.md).

Documentation
-------------

[](#documentation)

Comprehensive documentation is available at .

Versioned documentation is published with `mike`. The Docs workflow validates docs on pull requests, publishes every push to `develop` as the `develop` docs version, and publishes release documentation from release tags such as `v2.1.0`. Stable releases move the `latest` alias and default redirect to the released docs version.

For local checks and manual publishing:

```
pip install -r docs/requirements.txt
mkdocs build --strict
mike deploy --push develop
mike deploy --push --update-aliases 2.1.0 latest
mike set-default --push latest
```

Find yourself stuck using the package? Found a bug? Do you have general questions or suggestions for improving the media library? Feel free to create an issue on GitHub, we'll try to address it as soon as possible.

Testing
-------

[](#testing)

Run the test suite with:

```
composer test
```

For more detailed testing options:

```
# Run with code coverage
composer test -- --coverage-html=build/coverage

# Run static analysis
composer analyze
```

Changelog
---------

[](#changelog)

All notable changes to this project are documented in the [CHANGELOG.md](CHANGELOG.md) file.

Contributing
------------

[](#contributing)

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to this project.

Security
--------

[](#security)

If you discover a security vulnerability, please send an email to  instead of using the issue tracker. All security vulnerabilities will be promptly addressed.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance94

Actively maintained with recent releases

Popularity32

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94% 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

Every ~23 days

Recently: every ~3 days

Total

9

Last Release

26d ago

Major Versions

v1.0.2 → v2.0.02026-06-15

v2.1.0 → v3.0.02026-06-20

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/61078470?v=4)[maniaba](/maintainers/maniaba)[@maniaba](https://github.com/maniaba)

---

Top Contributors

[![maniaba](https://avatars.githubusercontent.com/u/61078470?v=4)](https://github.com/maniaba "maniaba (158 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (3 commits)")

---

Tags

asset-managementcodeingitercodigniter4file-uploadfilemanagementphp83codeigniterfilesfile-uploadphp8.3asset managementcodeigniter4filemanagementfile-connect

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/maniaba-asset-connect/health.svg)

```
[![Health](https://phpackages.com/badges/maniaba-asset-connect/health.svg)](https://phpackages.com/packages/maniaba-asset-connect)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.5k](/packages/laravel-framework)[league/flysystem

File storage abstraction for PHP

13.6k679.9M2.6k](/packages/league-flysystem)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.7k285.7M1.1k](/packages/league-flysystem-aws-s3-v3)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M600](/packages/shopware-core)[contao/core-bundle

Contao Open Source CMS

1231.6M2.8k](/packages/contao-core-bundle)

PHPackages © 2026

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