Download the PHP package sextanet/laravel-files without Composer
On this page you can find all versions of the php package sextanet/laravel-files. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sextanet/laravel-files
More information about sextanet/laravel-files
Files in sextanet/laravel-files
Package laravel-files
Short Description Connect real files with your models in Laravel 12+
License MIT
Homepage https://github.com/sextanet/laravel-files
Informations about the package laravel-files
Laravel Files
Upload seamless Storage and Database files in Laravel
It supports:
- Native Laravel filesystems, such as
public,local,s3disks - Local Temporary URLs
- Scoped disks
Requirements
- Laravel 11+
- PHP 8.3+
Installation
Publish and run the migrations with:
Usage
We're ready! You can reuse it in each model, any times!
Add (and Store)
Passing a destination and name
Get
You can get the path, url and temporary_url for each file
Get owner
Get all files
Get the latest file
Download
Without parameters
With custom parameters
Turn off the extensions
By default it preserves the extension. You can disable that by passing preserveExtension to false
Preserve original names
By default, it doesn't preserves original empty custom names.
[!CAUTION] If you enable that, you could overwrite your existent files.
Advanced usage
Passing a type
Type doesn't represent a real type or mimetype, it's only an optional field
Passing custom minutes in each implementation
Global usage
Passing custom minutes globally
Passing a different disk in a specific instance
Custom keys
By default, we use the same CURRENT_DISK that you have in your .env file. If you want to force to use different values, you can add these keys with different values:
Another disk
Custom minutes
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-files with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^12.0||^13.0
league/flysystem Version ^3.25.1