PHPackages                             azaharizaman/nexus-storage - 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. azaharizaman/nexus-storage

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

azaharizaman/nexus-storage
==========================

Framework-agnostic file storage abstraction for the Nexus ERP system

v0.1.0-alpha1(2mo ago)024MITPHPPHP ^8.3

Since May 5Pushed 2mo agoCompare

[ Source](https://github.com/azaharizaman/nexus-storage)[ Packagist](https://packagist.org/packages/azaharizaman/nexus-storage)[ RSS](/packages/azaharizaman-nexus-storage/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (1)Versions (2)Used By (4)

Nexus\\Storage
==============

[](#nexusstorage)

**Framework-agnostic file storage abstraction for the Nexus ERP system.**

Overview
--------

[](#overview)

`Nexus\Storage` provides a single set of contracts to abstract the underlying file system (local disk, S3, Azure Blob Storage, etc.). This package is a pure PHP utility that defines **what** storage operations are needed, not **how** they are implemented.

Core Philosophy
---------------

[](#core-philosophy)

- ✅ **Pure PHP Interfaces** - No framework dependencies
- ✅ **Stream-First Design** - Efficient handling of large files
- ✅ **Driver Pattern** - Swap storage backends without code changes
- ✅ **Security-Focused** - Built-in path validation and URL signing

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

[](#installation)

```
composer require azaharizaman/nexus-storage
```

Core Contracts
--------------

[](#core-contracts)

### StorageDriverInterface

[](#storagedriverinterface)

The primary interface for file operations:

```
use Nexus\Storage\Contracts\StorageDriverInterface;

$driver->put('invoices/2024/invoice-001.pdf', $stream);
$driver->get('invoices/2024/invoice-001.pdf');
$driver->exists('invoices/2024/invoice-001.pdf');
$driver->delete('invoices/2024/invoice-001.pdf');
$driver->createDirectory('invoices/2024');
$driver->listFiles('invoices/2024');
```

### PublicUrlGeneratorInterface

[](#publicurlgeneratorinterface)

For generating secure, time-limited URLs:

```
use Nexus\Storage\Contracts\PublicUrlGeneratorInterface;

$url = $urlGenerator->getTemporaryUrl('private/contract.pdf', 3600);
// Returns: https://s3.amazonaws.com/bucket/private/contract.pdf?signature=...
```

Value Objects
-------------

[](#value-objects)

### Visibility

[](#visibility)

```
use Nexus\Storage\ValueObjects\Visibility;

$visibility = Visibility::Public;
$visibility = Visibility::Private;
```

### FileMetadata

[](#filemetadata)

```
use Nexus\Storage\ValueObjects\FileMetadata;

$metadata = new FileMetadata(
    path: 'documents/file.pdf',
    size: 1024000,
    mimeType: 'application/pdf',
    lastModified: new \DateTimeImmutable()
);
```

Exception Handling
------------------

[](#exception-handling)

All exceptions extend `Nexus\Storage\Exceptions\StorageException`:

```
use Nexus\Storage\Exceptions\FileNotFoundException;
use Nexus\Storage\Exceptions\InvalidPathException;
use Nexus\Storage\Exceptions\StorageException;

try {
    $driver->get('missing.pdf');
} catch (FileNotFoundException $e) {
    // Handle missing file
} catch (StorageException $e) {
    // Handle general storage errors
}
```

Implementation in Applications
------------------------------

[](#implementation-in-applications)

This package only provides contracts. Applications like `Nexus\Atomy` implement these contracts:

```
// In Atomy's AppServiceProvider.php
$this->app->singleton(StorageDriverInterface::class, FlysystemDriver::class);
$this->app->singleton(PublicUrlGeneratorInterface::class, S3UrlSigner::class);
```

Requirements Compliance
-----------------------

[](#requirements-compliance)

This package implements the following requirements from `REQUIREMENTS.csv`:

- **FR-STO-101**: StorageDriverInterface with core methods
- **FR-STO-102**: Stream handling for large files
- **FR-STO-103**: Visibility control
- **FR-STO-104**: PublicUrlGeneratorInterface
- **FR-STO-105**: Directory operations

See `REQUIREMENTS.csv` for complete specification.

Architecture
------------

[](#architecture)

```
┌─────────────────────────────────────┐
│    Your Application (Atomy)         │
│  ┌─────────────────────────────┐   │
│  │   FlysystemDriver           │   │
│  │   (implements               │   │
│  │    StorageDriverInterface)  │   │
│  └─────────────────────────────┘   │
└─────────────────────────────────────┘
              ▲
              │ implements
              │
┌─────────────────────────────────────┐
│     Nexus\Storage (this package)    │
│  ┌─────────────────────────────┐   │
│  │   StorageDriverInterface    │   │
│  │   (pure PHP interface)      │   │
│  └─────────────────────────────┘   │
└─────────────────────────────────────┘

```

📖 Documentation
---------------

[](#-documentation)

### Package Documentation

[](#package-documentation)

- **[Getting Started Guide](docs/getting-started.md)** - Quick start guide with prerequisites, concepts, and first integration
- **[API Reference](docs/api-reference.md)** - Complete documentation of all interfaces, value objects, and exceptions
- **[Integration Guide](docs/integration-guide.md)** - Laravel and Symfony integration examples
- **[Basic Usage Example](docs/examples/basic-usage.php)** - Simple usage patterns
- **[Advanced Usage Example](docs/examples/advanced-usage.php)** - Advanced scenarios and patterns

### Additional Resources

[](#additional-resources)

- `IMPLEMENTATION_SUMMARY.md` - Implementation progress and metrics
- `REQUIREMENTS.md` - Detailed requirements
- `TEST_SUITE_SUMMARY.md` - Test coverage and results
- `VALUATION_MATRIX.md` - Package valuation metrics
- See root `ARCHITECTURE.md` for overall system architecture

License
-------

[](#license)

MIT License - see LICENSE file for details.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance84

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

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

81d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/117408?v=4)[Azahari Zaman](/maintainers/azaharizaman)[@azaharizaman](https://github.com/azaharizaman)

---

Top Contributors

[![azaharizaman](https://avatars.githubusercontent.com/u/117408?v=4)](https://github.com/azaharizaman "azaharizaman (460 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (139 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/azaharizaman-nexus-storage/health.svg)

```
[![Health](https://phpackages.com/badges/azaharizaman-nexus-storage/health.svg)](https://phpackages.com/packages/azaharizaman-nexus-storage)
```

###  Alternatives

[olivierbon/craft-squeeze

Zip one or multiple craft assets on the fly for frontend user to download.

137.5k](/packages/olivierbon-craft-squeeze)

PHPackages © 2026

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