Download the PHP package mattmy/laravel-file-magic without Composer
On this page you can find all versions of the php package mattmy/laravel-file-magic. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mattmy/laravel-file-magic
More information about mattmy/laravel-file-magic
Files in mattmy/laravel-file-magic
Package laravel-file-magic
Short Description Securely accept, validate, store, query, download, and delete files through one fluent Laravel API.
License MIT
Informations about the package laravel-file-magic
FileMagic
繁體中文
Manage files in Laravel through one clear API. FileMagic stores file records with Eloquent and works with Laravel Filesystem disks, so you can upload, find, read, download, and delete files without building the same workflow for every source.
What you can do
- Store uploaded files, local files, content, Base64, and remote HTTP(S) files.
- Generate and store TXT, JSON, and CSV documents.
- Choose the disk, directory, filename, visibility, and collision behavior for each file.
- Limit file size and allow or block MIME types.
- Attach metadata and associate files with Eloquent models.
- Resize supported images before storage.
- Find files by ID, UUID, model, array, or Laravel Collection.
- Read file contents, open streams, create URLs, and return downloads.
- Download multiple files as ZIP or delete files in batches.
- Audit database records whose physical files are missing.
Requirements
- PHP 8.3 or later
- Laravel 12 or 13
- PHP
ext-fileinfo - A configured Laravel Filesystem disk
Remote files need PHP ext-curl. Image resizing needs Intervention Image 4 with GD or
Imagick. ZIP downloads need PHP ext-zip.
Installation
Quick start
Store files from different sources
Generate documents with the same storage options:
Configure a file
Use resizeImage() when supported images should be reduced before storage:
Find and use stored files
Use readStream() instead of contents() for large files, and close the returned stream
when finished.
ZIP downloads and deletion
Applications must authorize every file before reading, downloading, or deleting it.
Consistency audits
Check whether database records still have matching files on storage:
The command is read-only unless --delete-missing-records is supplied. Remote disks may
add network time and storage request charges, so review the audit guide before scheduling
cleanup.
Handle errors
All package exceptions extend FileMagicException:
Documentation
For every method, field, parameter, exception, configuration option, performance note, and security recommendation, see the FileMagic documentation.
Report vulnerabilities privately according to SECURITY.md.
License
FileMagic is open-source software licensed under the MIT License.
All versions of laravel-file-magic with dependencies
ext-fileinfo Version *
guzzlehttp/psr7 Version ^2.7
illuminate/console Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/database Version ^12.0|^13.0
illuminate/filesystem Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
psr/http-message Version ^1.1|^2.0
symfony/http-foundation Version ^7.0|^8.0
symfony/mime Version ^7.0|^8.0