Download the PHP package univpancasila/storage-up without Composer
On this page you can find all versions of the php package univpancasila/storage-up. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download univpancasila/storage-up
More information about univpancasila/storage-up
Files in univpancasila/storage-up
Package storage-up
Short Description A Laravel package developed by the Internal Organization of the University of Pancasila, designed to simplify file storage management. This package provides an intuitive facade for uploading, retrieving, and managing files across organizational applications through a unified API.
License MIT
Homepage https://github.com/univpancasila/storageup-facade
Informations about the package storage-up
StorageUp - Laravel File Storage Package
A Laravel package by the Internal Organization of the University of Pancasila. Provides a clean facade for uploading, retrieving, and deleting files via a unified storage API.
Features
- Simple facade interface with fluent method chaining
- Polymorphic relations — attach files to any Eloquent model
- Named collections for organizing files
- Automatic HTTP retry (configurable)
- Database tracking of all file metadata
- Composite indexes for fast lookups
- 54 tests with comprehensive coverage
Requirements
- PHP 8.1, 8.2, 8.3, or 8.4
- Laravel 9.x, 10.x, 11.x, 12.x, or 13.x
- Guzzle HTTP Client 7.0+
Installation
1. Install via Composer
2. Publish configuration
3. Publish and run migrations
4. Configure environment
Basic Usage
Upload a File
Retrieve Files
Delete Files
Advanced Usage
Custom API Configuration
Any Eloquent Model
Model Integration
Add a relationship to any model that needs file storage:
Usage:
Controller Example
API Reference
Facade Methods
| Method | Description |
|---|---|
apiKey(string $apiKey): self |
Set API key |
apiUrl(string $url): self |
Set custom API URL |
collection(string $name): self |
Set collection name |
for(Model $model): self |
Bind to an Eloquent model |
upload(UploadedFile $file, ?string $type = null): StorageFile |
Upload file |
getFile(Model $model, string $collectionName, bool $latest = false) |
Retrieve files |
deleteFile(StorageFile $file): ?bool |
Delete a file |
deleteAllFiles(Model $model, ?string $collectionName = null): void |
Bulk delete |
StorageFile Attributes
StorageFile Methods
Configuration
config/storageup.php:
Use multiple API keys:
Apply validation in controllers:
Error Handling
Possible exception messages:
"API key not set. Use apiKey() method first."— callapiKey()beforeupload()"Model not set. Use for() method first."— callfor()beforeupload()"Failed to upload file to storage service."— network or API error
Testing
Mocking in your application tests:
Blade Example
Performance Tips
Cache frequently accessed URLs:
Eager load relationships:
Troubleshooting
Facade not found
Files not in database
Upload fails — verify API key, URL reachability, and file size against STORAGE_UP_MAX_SIZE.
Changelog
See CHANGELOG for recent changes.
Contributing
Pull requests are welcome. For development setup:
Security
Report security issues to [email protected] instead of the issue tracker.
Credits
License
MIT — see LICENSE.
All versions of storage-up with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^9.0|^10.0|^11.0|^12.0|^13.0
guzzlehttp/guzzle Version ^7.0