Filament plugin

A file library for Filament panels, with folders, versions and previews.

Folders with passwords and sharing, a version history on every file, and previews of PDFs and Office files. A file is stored once and can sit in a folder and on any number of records, and every open goes through your app.

Filament 5 · Laravel 12 or 13 · PHP 8.3 or later · No Spatie

Drawn example: the Files page in a panel
One file, many places

Kept once, found wherever it's needed

A file sits in a folder, on a job's photos, and on a contract's documents at the same time. Its bytes are stored once, under their checksum, so a second copy of the same upload takes no space. Rename it and nothing moves on the disk.

In a folder Health and safety Shared with Site leads
Site induction.pdf Version 3 · 12 pages · 1.8 MB
On a record Job 1042 In its documents slot
On a record Contract 18 In its documents slot

The field on a record's form and the record's Files tab are two views of the same link, so a file added on one shows on the other.

Features

Everything a library needs, and what most leave out

Library

Folders that decide who sees what

A folder is open to everyone, to its creator only, or to the groups your app offers, such as a board or a site team. A password locks a folder and every folder inside it, and downloads can be turned off for a branch. Only a folder's creator changes who sees it.

Drawn example: folders shared, private and locked
Versions

A history on every file

Upload a new version and the old ones stay, each with its checksum. An upload with the same bytes as the current version isn't added, and the person is told so.

Drawn example: a file's versions
Previews

PDFs first, and Office files too

Each PDF gets its page count and a thumbnail of its first page. An Office file gets a PDF copy through Gotenberg to preview in its place. Pictures, video and sound play on the page.

Drawn example: thumbnails in the grid
Checks

Checked before it's kept

Every upload passes the size limit, then a list of checks you control: its type read from its contents, a pixel limit read from the header before anything opens a picture, and a virus scan through ClamAV. SVG is never kept, since it can run script. Add a check of your own, or take one out.

Drawn example: the upload window after two files
Delivery

Every open goes through your app

A file's link is a route on your panel, not a signed bucket address someone can pass on. Each request checks the person can reach the file, and the file is sent with no-store so the browser keeps no copy. Byte ranges let a long PDF show its first page before the rest arrives.

Drawn example: one download, and what it sends
Access log

Who opened what, and when

Each view and download is written to a table, and FileOpened fires so your app can write it to its own audit log too. A PDF read in several pieces counts as one open.

Drawn example: rows in the access log
On records

Files on any record, in slots you name

Add HasFiles to a model and its files sit in slots such as photos or receipts. The form field uploads, or chooses from the library, and the Files tab lists every slot. Who sees a record's files is up to your app, one class for each record type.

Drawn example: a job's photos field, and its Files tab
Also
  • A bin, with Restore, for the people your app lets manage the library.
  • Multi-tenant with Filament's tenancy or stancl/tenancy: each tenant's rows under its key, and its files in its own folder on the disk.
  • A public disk is refused, since every file has to go through your app.
  • A copy for each reader, such as one with their name on every page, through one interface.
  • An event for every change, from FileKept to FolderDeleted.
  • A folder tree marked up for screen readers, and buttons that work on a touch screen.
Settings

Every feature switches off

Versions, the bin, passwords, private folders, previews, bulk actions and the log each have a switch. The page's label, icon, group, position and placement can be changed in config or in code, and every string reworded in lang/vendor/fileble.

Moving over

Leave the files where they are

Fileble::adopt() takes on a file already on a disk, without copying it or checking it again. Move one collection at a time from another media library, in a command you can run again if it stops part way.

// For each file in the old library
Fileble::adopt(disk: 's3-files', path: $old->path, name: $old->name)
    ->on($old->record, 'documents')
    ->by($old->uploaded_by)
    ->at($old->created_at)
    ->once('old-library:'.$old->id)
    ->save();
Install

Install Fileble

Fileble's migrations run from the package, so your app keeps no copy of them. It needs Filament 5, Laravel 12 or 13 and PHP 8.3 or later, and nothing from Spatie.

  1. # Install the package
    composer require polycode/fileble
  2. # Point Fileble at a private disk in .env
    FILEBLE_DISK=s3
  3. # Make its tables
    php artisan migrate
  4. # Register the plugin on each panel that opens files
    ->plugin(FileblePlugin::make())

The docs cover files on records, previews, the checks and every setting.

Pricing

One licence for each app, or one for all of them

Each licence comes with a year of updates. Renew to keep updating, or keep the version you have for as long as you like.

1

How many apps will use Fileble?

  • For one app

    One project

    US$129for the first year

    • The library, versions, previews, the access log and files on records
    • The app's staging, testing and development copies
    • Use in an app you build for a client
    • A year of updates

    Then US$65 a year to keep updating.

    Email to buy

To buy a licence, email hello@polycode.co.nz. A project is one application, including its staging, testing and development copies. The terms are in the licence.

Questions

Questions

Does it need Spatie's media library?

No. Fileble needs only Laravel and Filament. To move files over from another library, Fileble::adopt() takes each one on where it's stored.

Which disks does it work with?

Any private disk Laravel supports, such as S3 or a local folder outside public/. Fileble refuses a public disk, because every file has to go through your app.

What do the previews need on the server?

Thumbnails need PHP's GD extension, and PDF page counts and first pages need Poppler. Office previews need a Gotenberg server; without one, Office files download instead.

Will people see the name Fileble?

No. The page is called Files, in your panel's colours, and you can rename it. Fileble's name appears in your code and config.

Does it work in a multi-tenant app?

Yes, with Filament's tenancy or stancl/tenancy. Every row is kept under the tenant's key and every file in the tenant's own folder on the disk, so one tenant never finds another's.

Can I use it in an app I build for a client?

Yes. The licence then belongs to that project, and your client can keep using it.

Where do I ask something else, or report a problem?

Ask in Discussions or report a problem as an issue, at fileble-support on GitHub. For your licence or a refund, email hello@polycode.co.nz.