PHPackages                             alex-oliveira/ao-files - 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. alex-oliveira/ao-files

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

alex-oliveira/ao-files
======================

Resources for Files with Laravel.

08PHP

Since May 30Pushed 8y ago1 watchersCompare

[ Source](https://github.com/alex-oliveira/ao-files)[ Packagist](https://packagist.org/packages/alex-oliveira/ao-files)[ RSS](/packages/alex-oliveira-ao-files/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Ao-Files
========

[](#ao-files)

### 1) Installing

[](#1-installing)

```
$ composer require alex-oliveira/ao-files

```

### 2) Configuring "config/app.php" file

[](#2-configuring-configappphp-file)

```
'providers' => [
    /*
     * Vendor Service Providers...
     */
    AoFiles\ServiceProvider::class,
],

```

### 3) Publish migrations

[](#3-publish-migrations)

```
$ php artisan vendor:publish
$ composer dump

```

Utilization
===========

[](#utilization)

Migration
---------

[](#migration)

### Up

[](#up)

```
public function up()
{
    AoFiles()->schema()->create('posts');
}

```

the same that

```
public function up()
{
    Schema::create('ao_files_x_posts', function (Blueprint $table) {
        $table->integer('post_id')->unsigned();
        $table->foreign('post_id', 'fk_posts_x_ao_files')->references('id')->on('posts');

        $table->bigInteger('file_id')->unsigned();
        $table->foreign('file_id', 'fk_ao_files_x_posts')->references('id')->on('ao_files_files');

        $table->primary(['post_id', 'file_id'], 'pk_ao_files_x_posts');
    });
}

```

### Down

[](#down)

```
public function down()
{
    AoFiles()->schema()->drop('posts');
}

```

the same that

```
public function down()
{
    Schema::dropIfExists('ao_files_x_posts');
}

```

Model
-----

[](#model)

```
namespace App\Models;

use AoFiles\Models\File;
use Illuminate\Database\Eloquent\Model;

class Post extends Model
{

    /**
     * @return File[]|\Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function files()
    {
        return $this->belongsToMany(File::class, AoFiles()->schema()->table($this->getTable()));
    }

}

```

the same that

```
return $this->belongsToMany(File::class, 'ao_files_x_posts');

```

Controller
----------

[](#controller)

```
namespace App\Http\Controllers\Posts;

use AoFiles\Controllers\AoFilesController;
use App\Models\Post;

class FilesController extends AoFilesController
{

    protected $dynamicClass = Post::class;

    protected $subFolders = ['posts' => 'post_id'];

}

```

Routes
------

[](#routes)

```
Route::group(['prefix' => 'posts', 'as' => 'posts.'], function () {

    AoFiles()->router()->controller('Posts\FilesController')->foreign('post_id')->make();
    .
    .
    .

});

```

### Checking routes

[](#checking-routes)

```
$ php artisan route:list

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e826fd88857da403181f2a4e7f1834909414a5ded31cc5e9362c5677dae92877?d=identicon)[alex-oliveira](/maintainers/alex-oliveira)

---

Top Contributors

[![alex-oliveira](https://avatars.githubusercontent.com/u/5826507?v=4)](https://github.com/alex-oliveira "alex-oliveira (3 commits)")

### Embed Badge

![Health badge](/badges/alex-oliveira-ao-files/health.svg)

```
[![Health](https://phpackages.com/badges/alex-oliveira-ao-files/health.svg)](https://phpackages.com/packages/alex-oliveira-ao-files)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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