Download the PHP package laravel-afterburner/documents without Composer
On this page you can find all versions of the php package laravel-afterburner/documents. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laravel-afterburner/documents
More information about laravel-afterburner/documents
Files in laravel-afterburner/documents
Package documents
Short Description Document management package for Afterburner applications
License MIT
Informations about the package documents
Afterburner Documents Package
Team-scoped document management package for Laravel Afterburner Jetstream.
Features
- FilePond uploads to Cloudflare R2 — Hybrid single-request and native chunked uploads for large files (multi-GB supported without raising PHP upload limits)
- Folder and file structure — Google Drive-like hierarchical organization with slug-based URLs
- Version control — Track revisions and editors; per-team toggle in System Settings
- Document linking — Attach documents to other team records (ballots, meetings, etc.) via polymorphic links
- In-browser preview — PDF, images, and plain text preview without downloading
- Document permissions by role — Fine-grained access control with team-scoped permission gates
- Retention tags — BC record-keeping compliance; per-team toggle in System Settings
- Search and filter — Find documents quickly in the index UI
- Audit trail — Track edits, deletions, and access (upload chunk requests are excluded from noisy HTTP audit logging)
- Upload notifications — Optional database notifications when large or slow uploads complete
Installation
Prerequisites
This package requires the AWS S3 Flysystem adapter (Cloudflare R2 is S3-compatible) and Spatie Livewire FilePond:
Local Development Setup
For local development, add the package as a path repository:
Quick Install (Recommended)
Run the install command to automatically set up the package:
This command will:
- Publish config, migrations, and views
- Publish FilePond static assets (required for uploads)
- Add required environment variables to your
.envfile (with placeholder values) - Update
.env.exampleif it exists - Optionally run migrations and seed document permissions
Manual Install
If you prefer to install manually:
If you use migrate:fresh --seed, add DocumentPermissionsSeeder to your app's DatabaseSeeder (after SystemAdminSeeder). The seeder is also registered with PackageSeederRegistry when available. Without it, folder and retention-tag actions stay hidden because roles only receive view_documents / create_documents from the default role templates—not manage_folders.
Configuration
After installation, configure your Cloudflare R2 credentials in .env. The install command will have added placeholder values — replace them with your actual credentials:
Note: You can also use the generic CLOUDFLARE_R2_* environment variables if you have them set up for other parts of your application. The package will fall back to those if the specific AFTERBURNER_DOCUMENTS_R2_* variables aren't set.
When R2 credentials are not configured, the package falls back to a local storage/app/documents disk for development.
Upload Configuration
The package uses FilePond native chunked uploads for files larger than CHUNK_SIZE, and single-request uploads for smaller files. Configure limits in your .env:
- MAX_FILE_SIZE: Maximum file size in bytes
- CHUNK_SIZE: FilePond chunk size and hybrid threshold (files larger than this use PATCH chunking)
- MAX_CHUNKS: Maximum number of chunks per upload
- SESSION_TTL_HOURS: How long abandoned upload sessions are kept before cleanup
- NOTIFY_ON_COMPLETE: Master switch for upload-complete database notifications
- NOTIFY_MIN_SECONDS: Only notify if upload + finalize took at least this many seconds
- NOTIFY_MIN_BYTES: Optional size floor in bytes; set to
0to notify based on time alone
PHP / web server requirements
Chunked uploads only require PHP and your web server to accept requests up to the chunk size (default ~5MB):
You do not need multi-gigabyte PHP upload limits for large files — chunks are uploaded separately and assembled server-side.
Cleanup command
Schedule the upload session cleanup command in your host app:
See CLOUDFLARE_R2_SETUP.md for detailed setup instructions.
Versioning and Retention
Global kill switches in config; per-team toggles live in System Settings → Documents:
Usage
Routes
| Route | Name | Description |
|---|---|---|
GET /teams/{team}/documents |
teams.documents.index |
Document index (root folder) |
GET /teams/{team}/documents/{folder_slug} |
teams.documents.folder |
Browse a folder |
GET /teams/{team}/documents/{document}/download |
teams.documents.download |
Download a document |
GET /teams/{team}/documents/{document}/preview |
teams.documents.preview |
Inline browser preview |
POST /teams/{team}/documents/upload |
teams.documents.upload.process |
FilePond upload init |
PATCH /teams/{team}/documents/upload/{uploadId} |
teams.documents.upload.patch |
FilePond chunk upload |
The package registers a Documents navigation item and a Documents section in System Settings when the host app provides Navigation and SystemSettings support classes.
Livewire Components
| Component | Description |
|---|---|
documents.index |
Main document browser (folders, uploads, search, preview) |
documents.document-viewer |
Document detail and version history modal |
documents.settings.documents-settings |
Team settings for versioning and retention tags |
Linking Documents to Other Records
Use the HasDocumentLinks trait on any Eloquent model that belongs to a team, then link documents with the provided actions:
Permissions
Document permissions are seeded by DocumentPermissionsSeeder and enforced through Laravel policies (DocumentPolicy, FolderPolicy, RetentionTagPolicy). Team owners receive full document permissions automatically.
Available permission slugs include: view_documents, create_documents, edit_documents, delete_documents, download_documents, manage_folders, manage_retention_tags, view_document_versions, and others — see DocumentPermissionDefinitions for the full list.
Testing
The package includes a PHPUnit test suite using Orchestra Testbench:
License
MIT License
All versions of documents with dependencies
laravel/framework Version ^11.0
laravel-afterburner/jetstream Version ^1.0|dev-master
livewire/livewire Version ^3.5
league/flysystem-aws-s3-v3 Version ^3.30
spatie/livewire-filepond Version ^1.0