anomaly / files-module
Powerful asset management made easy.
Installs: 50 846
Dependents: 4
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 26
Type:streams-addon
pkg:composer/anomaly/files-module
Requires
- anomaly/streams-platform: ^1.10
- 2.7.x-dev
- v2.7.0
- 2.6.x-dev
- v2.6.30
- v2.6.29
- v2.6.28
- v2.6.27
- v2.6.26
- v2.6.25
- v2.6.24
- v2.6.23
- v2.6.22
- v2.6.21
- v2.6.20
- v2.6.19
- v2.6.18
- v2.6.17
- v2.6.16
- v2.6.15
- v2.6.14
- v2.6.13
- v2.6.12
- v2.6.11
- v2.6.10
- v2.6.9
- v2.6.8
- v2.6.7
- v2.6.6
- v2.6.5
- v2.6.4
- v2.6.3
- v2.6.2
- v2.6.1
- v2.6.0
- 2.5.x-dev
- v2.5.12
- v2.5.11
- v2.5.10
- v2.5.9
- v2.5.8
- v2.5.7
- v2.5.6
- v2.5.5
- v2.5.4
- v2.5.3
- v2.5.2
- v2.5.1
- v2.5.0
- 2.4.x-dev
- v2.4.6
- v2.4.5
- v2.4.4
- v2.4.3
- v2.4.2
- v2.4.1
- v2.4.0
- 2.3.x-dev
- v2.3.6
- v2.3.5
- v2.3.4
- v2.3.3
- v2.3.2
- v2.3.1
- v2.3.0
- 2.2.x-dev
- v2.2.29
- v2.2.28
- v2.2.27
- v2.2.26
- v2.2.25
- v2.2.24
- v2.2.23
- v2.2.22
- v2.2.16
- v2.2.15
- v2.2.14
- v2.2.13
- v2.2.12
- v2.2.11
- v2.2.10
- v2.2.9
- v2.2.8
- v2.2.7
- v2.2.6
- v2.2.5
- v2.2.4
- v2.2.3
- v2.2.2
- v2.2.1
- v2.2.0
- 2.1.x-dev
- v2.1.21
- v2.1.20
- v2.1.19
- v2.1.18
- v2.1.17
- v2.1.16
- v2.1.15
- v2.1.14
- v2.1.13
- v2.1.12
- v2.1.11
- v2.1.10
- v2.1.9
- v2.1.8
- v2.1.7
- v2.1.6
- v2.1.5
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.36
- v2.0.35
- v2.0.34
- v2.0.33
- v2.0.32
- v2.0.31
- v2.0.30
- v2.0.29
- v2.0.28
- v2.0.27
- v2.0.26
- v2.0.25
- v2.0.24
- v2.0.23
- v2.0.22
- v2.0.21
- v2.0.20
- v2.0.19
- v2.0.18
- v2.0.17
- v2.0.16
- v2.0.15
- v2.0.14
- v2.0.13
- v2.0.12
- v2.0.11
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.1.37
- v1.1.36
- v1.1.35
- v1.1.34
- v1.1.33
- v1.1.32
- v1.1.31
- v1.1.30
- v1.1.29
- v1.1.28
- v1.1.27
- v1.1.26
- v1.1.25
- v1.1.24
- v1.1.23
- v1.1.22
- v1.1.21
- v1.1.20
- v1.1.19
- v1.1.18
- v1.1.17
- v1.1.16
- v1.1.15
- v1.1.14
- v1.1.13
- v1.1.12
- v1.1.11
- v1.1.10
- v1.1.9
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.15
- v1.0.14
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
This package is auto-updated.
Last update: 2025-12-04 02:17:40 UTC
README
anomaly.module.files
Powerful asset management made easy.
The Files Module provides comprehensive file and media management with multiple storage adapters and image manipulation capabilities.
Features
- File management interface
- Folder organization
- Multiple storage adapters (local, S3, etc.)
- Image manipulation
- File uploads
- Access control
- Thumbnail generation
- Drag & drop interface
Usage
Uploading Files
use Anomaly\FilesModule\File\Contract\FileRepositoryInterface; $files = app(FileRepositoryInterface::class); // Upload from request $file = $files->upload(request()->file('upload'), $folder); // Create from path $file = $files->create([ 'name' => 'document.pdf', 'folder_id' => $folderId, 'disk_id' => $diskId, 'path' => 'path/to/file.pdf' ]);
Accessing Files
// Get file by ID $file = $files->find(1); // Get file URL $url = $file->path(); // Get thumbnail $thumb = $file->thumbnail('small'); // Get image dimensions $width = $file->width; $height = $file->height;
In Twig
{# Display image #} <img src="{{ image(file).fit(800, 600) }}" alt="{{ file.name }}"> {# With image manipulation #} <img src="{{ image(file).resize(300, 200).quality(90) }}"> {# File download link #} <a href="{{ file.path() }}" download>{{ file.name }}</a> {# Check file type #} {% if file.isImage() %} <img src="{{ file.path() }}"> {% endif %} {# File information #} <p>Size: {{ file.size_human }}</p> <p>Type: {{ file.mime_type }}</p> <p>Uploaded: {{ file.created_at|date('F j, Y') }}</p>
Image Manipulation
{# Resize #} {{ image(file).resize(400, 300) }} {# Fit within bounds #} {{ image(file).fit(800, 600) }} {# Crop #} {{ image(file).crop(200, 200) }} {# Quality #} {{ image(file).quality(85) }} {# Chain methods #} {{ image(file).fit(600, 400).quality(90).blur(5) }}
Requirements
- Streams Platform ^1.10
- PyroCMS 3.10+
- GD or Imagick PHP extension
License
The Files Module is open-sourced software licensed under the MIT license.