bezpapirove/bezpapirove_php_lib
FileStorageFactory and FileStorageInterface, aligning well with Laravel’s filesystem abstractions (FilesystemManager, Filesystem). This reduces vendor lock-in and simplifies future cloud storage migrations.Storage::put() (which uses hashed names). This could integrate with Laravel’s Filesystem if adapted to use Laravel’s Storage facade.FileHandler to FileStorageFactory requires refactoring existing Laravel storage logic.ServiceProvider or Filesystem adapter), but its core functionality (file operations, path resolution) is directly applicable.composer require bezpapirove/bezpapirove_php_lib).FileStorageInterface could wrap Laravel’s Filesystem (e.g., Storage::disk('s3')->put()) with minimal glue code.config/filesystems.php support). Would require custom bindings.Str::uuid() or Ramsey\Uuid can bridge UUID generation/validation gaps.FileStorageFactory is incompatible with v1.x’s FileHandler. A parallel migration (dual support) or feature flags may be needed.aws.php config would need alignment.Filesystem or Cloud packages?Storage::hashNames()? Conflict risk if both are enabled.league/flysystem-aws-s3-v3 or Laravel’s built-in Filesystem.FileStorageInterface can decorate Laravel’s Filesystem (e.g., add UUID logic).aws.php config instead of reinventing.filesystem.stored) for consistency.| Step | Action | Risk |
|---|---|---|
| 1. Evaluation | Benchmark against Laravel’s Filesystem and Cloud packages. |
Low |
| 2. Proof of Concept | Wrap FileStorageFactory in a Laravel Filesystem adapter. |
Medium (integration effort) |
| 3. Dual Support | Use feature flags to support both v1.x (FileHandler) and v2.x. |
High (tech debt) |
| 4. Full Migration | Replace all Storage:: calls with library methods. |
High (breaking change) |
| 5. Testing | Validate S3/local performance, UUID collisions, and edge cases. | Medium |
BezPapiroveFilesystem class implementing Laravel’s Filesystem interface.class BezPapiroveFilesystem implements Filesystem
{
public function put($path, $contents, $options = [])
{
$uuid = Uuid::uuid4();
$storage = FileStorageFactory::createFromConfig(config('bezpapirove.storage'));
$storage->save($contents, $uuid);
return $uuid->toString();
}
// Implement other Filesystem methods...
}
config/filesystems.php:
'bezpapirove' => [
'driver' => 'bezpapirove',
'config' => config('bezpapirove.storage'),
],
aws.php and pass credentials to the library’s S3 config.hashNames() is disabled if using UUIDs globally.FileHandler for non-critical file ops.BezPapiroveFilesystem adapter.FileStorageFactory.Storage::queueUploads() for large files.FileStorage operation failures (e.g., S3 timeouts).| Scenario | Impact | Mitigation |
|---|---|---|
| Library Deprecation | Broken file storage | Fork and maintain internally. |
| S3 Credential Leak | Security breach | Use Laravel’s aws.php encryption. |
| UUID Collisions | File overwrites | Validate UUIDs before operations. |
| Local Storage Full | Application crashes | Implement Laravel’s disk fallback. |
| Version Mismatch | Runtime errors | Pin to a specific v2.x.x version. |
FileStorageFactory usage (local storage).Storage:: to library methods.aws.php vs. library S3 config).php artisan bezpapirove:storage:test to validate configs.How can I help you explore Laravel packages today?