Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Wopi Lib Laravel Package

champs-libres/wopi-lib

Laravel-friendly PHP library to integrate WOPI (Web Application Open Platform Interface) with Office Online/Collabora. Provides helpers to implement WOPI endpoints, token handling, file access, and callbacks so you can view/edit documents from your app.

View on GitHub
Deep Wiki
Context7

A standard and framework agnostic PHP library to facilitate the implementation of the WOPI protocol.

Frequently asked questions about Wopi Lib
How do I install champs-libres/wopi-lib in a Laravel project?
Run `composer require champs-libres/wopi-lib` in your project root. The package is framework-agnostic but works seamlessly with Laravel’s routing, middleware, and HTTP handling. No additional Laravel-specific setup is required beyond Composer installation.
Which Laravel versions does this package support?
The package is framework-agnostic and supports any Laravel 8.x or 9.x project. It leverages PSR standards (PSR-7, PSR-17, PSR-18) for compatibility. Test thoroughly with your Laravel version, as middleware or routing quirks may require minor adjustments.
Can I use this library with Collabora Online or OnlyOffice?
Yes, champs-libres/wopi-lib supports WOPI integration with Collabora Online, OnlyOffice, and Microsoft Office Online (Office 365). The library abstracts protocol details, so you only need to configure your storage backend and endpoints.
How do I handle file storage (e.g., S3, local filesystem) with this package?
The library is storage-agnostic. Use Laravel’s Filesystem (e.g., `Storage::disk()`) or Cloud Storage adapters to manage files. For large files, ensure your storage backend supports chunked uploads/downloads, as WOPI relies on streaming for performance.
What middleware should I use to secure WOPI endpoints in Laravel?
Use Laravel’s built-in middleware like `auth:sanctum` or `auth:api` to validate WOPI `AccessToken` and `UserId` claims. Exclude CSRF protection for WOPI endpoints if needed, but implement rate limiting (e.g., `throttle`) to prevent abuse.
How do I implement file locking for concurrent edits in WOPI?
The library provides a `DocumentLockManager` interface, but you must implement custom logic (e.g., database locks or Redis) to handle concurrent edits. Laravel’s database transactions or queue jobs can help manage lock contention.
Are there performance concerns for large files (e.g., 100MB+)?
WOPI supports streaming, but Laravel’s default request handling may not optimize for large files. Test with your storage backend and consider using Laravel Queues to offload file operations. Monitor memory usage and response times under load.
Can I use this package without a Symfony bundle?
Yes, this library is framework-agnostic. While a Symfony bundle exists (`champs-libres/wopi-bundle`), you can integrate it directly into Laravel by mapping WOPI endpoints to controllers and using the provided interfaces (e.g., `Wopi`, `DocumentManager`).
How do I validate WOPI tokens (e.g., JWT) in Laravel?
Use Laravel Sanctum or Passport to validate WOPI `AccessToken`. Ensure token expiration and revocation align with WOPI’s requirements. Custom middleware can decode and verify tokens before processing WOPI requests.
What testing tools or benchmarks are available for this package?
The package includes PHPSpec tests, GrumPHP inspections, and Infection mutation testing. Run `composer phpspec` or `composer infection` to verify quality. For Laravel integration, test WOPI endpoints with real Office clients (e.g., Office Online) and simulate concurrent requests.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity