PHPackages                             audentio/laravel-uploader - 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. audentio/laravel-uploader

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

audentio/laravel-uploader
=========================

1.2.9(3mo ago)02.0k↑14.3%2MITPHPPHP ^8.0

Since Nov 6Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/Audentio/laravel-uploader)[ Packagist](https://packagist.org/packages/audentio/laravel-uploader)[ RSS](/packages/audentio-laravel-uploader/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (10)Versions (33)Used By (0)

audentio/laravel-uploader
=========================

[](#audentiolaravel-uploader)

Installing
----------

[](#installing)

`composer require audentio/laravel-uploader`

Getting Started
---------------

[](#getting-started)

1. Run `php artisan vendor:publish` and choose the option for the library
2. Create an `Upload` model and implement the `\Audentio\LaravelUploader\Models\Interfaces\UploadModelInterface` interface, and use the `\Audentio\LaravelUploader\Models\Traits\UploadModelTrait` trait, Create the GraphQL type/resource, and reference these in config/audentioUploader.php
3. In routes/api.php add `\Audentio\LaravelUploader\LaravelUploader::routes();` to the end to register the uploader routes

Setting up uploads for a new content type
-----------------------------------------

[](#setting-up-uploads-for-a-new-content-type)

### Model

[](#model)

You'll need to make sure to implmement the `Audentio\LaravelUploader\Models\Interfaces\UploadContentInterface` interface, and use the `Audentio\LaravelUploader\Models\Traits\UploadContentTrait` trait on your model class.

Finally, you'll need to define a `_getUploaderConfig` method on your model that defines all the upload content fields and variants. For example:

```
protected function _getUploaderConfig(): array
{
    return [
        'thumbnail' => [
            'variants' => [
                'thumb' => [
                    'width' => 528,
                    'height' => 280,
                ],
            ],
        ],
    ];
}
```

Allowed options for each content field include `allowed_types`, `max_files`, `max_size`, `variants`.

Allowed options for each variant include `type` (`fill`, or `fit`), `width`, and `height`.

### GraphQL Resource

[](#graphql-resource)

#### Fields

[](#fields)

In both the `getOutputFields` and `getInputFields` for your GraphQL resource you'll need to add the following:

##### Output Fields

[](#output-fields)

`Model::addUploadGraphQLOutputFields($this->getGraphQLTypeName(), $fields);`

##### Input Fields

[](#input-fields)

`Model::addUploadGraphQLInputFields($baseScope, $fields);`

#### Mutations

[](#mutations)

##### Setup Upload Args (Before initializing the model)

[](#setup-upload-args-before-initializing-the-model)

```
$uploads = Model::setupUploadArgs($args['model']);
```

#### Validate Uploads (Before saving the model)

[](#validate-uploads-before-saving-the-model)

```
if (!$model->validateUploads($uploads, $errors)) {
    $this->validationError($info, $errors, 'model');
}
```

#### Save Uploads (After saving the model, preferrably in the same transaction)

[](#save-uploads-after-saving-the-model-preferrably-in-the-same-transaction)

```
$model->attachUploads($uploads);
```

Uploading Files
---------------

[](#uploading-files)

### Get an Upload

[](#get-an-upload)

GET `/api/upload/{id}`

### Create Upload

[](#create-upload)

POST `/api/upload`

Headers:

Parameters:

- `upload` The uploaded file
- `content_type` The content type (Should typically match the GraphQL Type name)
- `content_field` The upload field name (Will be defined on the input fields for the GraphQL Type associated under `uploads`)

Response Example:

```
{
  "success": true,
  "message": null,
  "payload": {
    "upload": {
      "id": "2e5a78f3-2dfe-4298-a73d-7de03937541a",
      "content_type": "Model",
      "content_field": "thumbnail",
      "variants": [
        {
          "file_hash": "75daeb8e884c63a7d3f3ecc3e325f606",
          "file_type": "image\/png",
          "file_size": 52375,
          "width": 276,
          "height": 146,
          "variant": "thumb",
          "url": "https:\/\/bucket-name.s3.us-west-1.amazonaws.com\/Uploads\/Model\/thumbnail\/2e5a78f3-2dfe-4298-a73d-7de03937541a\/thumb_fileName.png"
        }
      ]
    }
  }
}
```

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance82

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity70

Established project with proven stability

 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

Every ~65 days

Recently: every ~84 days

Total

31

Last Release

94d ago

Major Versions

0.0.9 → 1.0.0-alpha.12022-01-11

### Community

Maintainers

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

---

Top Contributors

[![JakeBooher](https://avatars.githubusercontent.com/u/179180?v=4)](https://github.com/JakeBooher "JakeBooher (36 commits)")

### Embed Badge

![Health badge](/badges/audentio-laravel-uploader/health.svg)

```
[![Health](https://phpackages.com/badges/audentio-laravel-uploader/health.svg)](https://phpackages.com/packages/audentio-laravel-uploader)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[illuminate/filesystem

The Illuminate Filesystem package.

15263.8M3.0k](/packages/illuminate-filesystem)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.1k3.4M81](/packages/unisharp-laravel-filemanager)[laravel/ai

The official AI SDK for Laravel.

9782.1M162](/packages/laravel-ai)[moonshine/moonshine

Laravel administration panel

1.3k239.9k76](/packages/moonshine-moonshine)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

721160.4k12](/packages/tallstackui-tallstackui)

PHPackages © 2026

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