Download the PHP package bardan-io/temp-media-for-laravel without Composer
On this page you can find all versions of the php package bardan-io/temp-media-for-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package temp-media-for-laravel
Laravel Temp Media
A Laravel package for handling temporary media uploads with automatic cleanup, built on top of Spatie Media Library.
Features
- ✅ Two-Phase Upload Pattern - Upload images first, associate with models later
- ✅ Automatic Cleanup - TTL-based expiration and background cleanup jobs
- ✅ Security - Session/user-based ownership validation
- ✅ Type Safety - Full PHP 8.2+ type declarations with strict types
- ✅ Events - Comprehensive event system for monitoring and logging
- ✅ Testing - Complete test suite with factories and feature tests
- ✅ Configurable - Extensive configuration options
- ✅ Production Ready - Built with SOLID principles and clean architecture
Installation
You can install the package via composer:
Publish and run the migrations:
Optionally, you can publish the config file:
Usage
Basic Upload Flow
Using the Trait
Add the HandlesTempMedia trait to your models:
API Endpoints
The package automatically registers these API routes:
Frontend Integration
Configuration
Commands
Cleanup Expired Media
Events
The package dispatches several events you can listen to:
Testing
Security
- UUID-based media IDs prevent enumeration
- Session/user ownership validation
- File type and size validation
- Rate limiting on upload endpoints
- Automatic cleanup prevents storage bloat
Architecture
The package follows clean architecture principles:
- Services - Business logic layer
- DTOs - Data transfer objects for type safety
- Contracts - Interfaces for dependency injection
- Events - Domain events for extensibility
- Traits - Reusable functionality for models
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.
All versions of temp-media-for-laravel with dependencies
spatie/laravel-medialibrary Version ^10.0|^11.0|^12.0
laravel/framework Version ^10.0|^11.0|^12.0