Search by

innoboxrr / laravel-uploads

Maintainers

Package info

github.com/innoboxrr/laravel-uploads

pkg:composer/innoboxrr/laravel-uploads

Transparency log

Statistics

Installs: 483

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.2.1 2025-08-16 00:13 UTC

This package is auto-updated.

Last update: 2026-08-22 19:05:35 UTC


README

One upload model, one API, soft-deletable.

File uploads scattered across a dozen tables is how you end up with orphaned S3 objects and no way to audit what a user actually sent you. This package gives uploads their own first-class model, with a REST resource around it.

$upload = $user->uploads()->create([
    'file' => $request->file('document'),
]);

$upload->delete();        // soft delete — recoverable
$upload->restore();       // undo
$upload->forceDelete();   // gone, and the stored object with it

What ships

Upload model UUID-indexed, polymorphic owner, soft deletes
UploadController Full REST resource — index, display, delete, restore, force delete
Form requests DisplayRequest, DeleteRequest, RestoreRequest, ForceDeleteRequest — authorisation per action
API routes Registered under a configurable prefix
Migrations Uploads table plus a dedicated UUID index migration for lookup performance

Soft delete first. A deleted upload is recoverable until someone deliberately destroys it. Users delete things by accident; the storage bill is cheaper than the support ticket.

UUID lookups. Files are addressed by UUID rather than sequential ID, so an upload URL does not leak how many files exist or let anyone enumerate them.

Install

composer require innoboxrr/laravel-uploads
php artisan vendor:publish --tag=laravel-uploads-config
php artisan migrate

Related

Part of Innobox R&R — 52 open-source packages extracted from production work. innobox.systems