bnine/filesbundle
Symfony 7+ bundle to manage files and directories linked to your entities. Provides secure upload/download (OneupUploader), browsing with breadcrumbs, Bootstrap/FontAwesome templates, directory management, and voter-based access control.
Project, UserMedia).oneup/uploader-bundle (for uploads) and frontend libraries (Bootstrap, Dropzone, jQuery), but these are standard in Symfony projects. No Laravel-specific conflicts exist.%kernel.project_dir%/uploads) limits flexibility. A Laravel TPM would need to adapt this or abstract it via a custom service.FileService and AbstractFileVoter must be replicated or mocked for Laravel’s security/auth system.Project → files) must be manually managed in Laravel’s Eloquent models.config/routes.yaml) won’t map directly to Laravel’s routes/web.php. Custom middleware or a facade layer would be needed.FileService and voters would require Laravel service providers and bindings.symfony/twig-bridge).canView, canEdit).isUploadable) must be mapped to Laravel’s authorization (e.g., Gate::allows).oneup/uploader-bundle, Twig) would necessitate significant refactoring or a wrapper layer.symfony/http-foundation), integration is more feasible.uploads/ directory is inflexible. A Laravel TPM would need to:
Storage facade).filesystem package.FileVoter logic to ensure equivalent authorization.Post::files()), the bundle’s design fits. If files are standalone (e.g., global media library), a custom solution may be simpler.Illuminate\Http\File for uploads.Storage facade for file management.Symfony’s mime component (if needed for MIME type detection).symfony/twig-bridge in a micro-service).symfony/uploader (a port of oneup/uploader-bundle) for upload logic.symfony/security-bundle for voters (if hybrid Symfony/Laravel) or map to Laravel’s gates.Project → files) must be defined in Laravel’s Eloquent models.Illuminate\Http\Request + Storage::put().storage/app/{domain}/{id}/.Storage::response().// Laravel Controller (replaces Symfony FileService)
public function initFiles(string $domain, int $id) {
Storage::makeDirectory("app/{$domain}/{$id}");
}
FileService) as Laravel bindings.// app/Providers/BNineFilesServiceProvider.php
public function register() {
$this->app->singleton(FileService::class, function ($app) {
return new LaravelFileService($app['storage']);
});
}
<x-dropzone id="dropzone" :options="$dropzoneOptions" />
// app/Policies/FilePolicy.php
public function canEdit(User $user, string $domain, int $id) {
return $user->hasRole('admin') || $user->ownsProject($id);
}
Storage, Filesystem) can replace Symfony’s oneup/uploader-bundle.Project).Storage, Filesystem) is well-documented and actively maintained.How can I help you explore Laravel packages today?