artisan-toolbox / filoquent
Preview foundations for connecting Laravel's filesystem to Eloquent model attributes.
Requires
- php: ^8.5
- artisan-toolbox/maintainer: ^1.10.0
- illuminate/console: ^13.0
- illuminate/database: ^13.0
- illuminate/filesystem: ^13.0
- illuminate/http: ^13.0
- illuminate/log: ^13.0
- illuminate/support: ^13.0
- laravel/prompts: ^0.3.25
- symfony/http-foundation: ^7.4 || ^8.0
- symfony/mime: ^7.4 || ^8.0
Requires (Dev)
- brianium/paratest: ~7.27.5
- driftingly/rector-laravel: ^2.7.3
- larastan/larastan: ^3.9
- laravel/pao: ^1.0
- laravel/pint: ^1.29
- orchestra/testbench: ^10.0||^11.0
- pestphp/pest: ^4.6||^5.0
- pestphp/pest-plugin-laravel: ^4.1||^5.0
- pestphp/pest-plugin-phpstan: ^5.3
- pestphp/pest-plugin-type-coverage: ^5.1
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.3.5
- phpstan/phpstan-mockery: ^2.0
- rector/rector: ^2.8.4
Suggests
- ext-redis: Use the phpredis driver for the optional Redis upload journal.
- illuminate/redis: Required for the optional Redis upload journal (^13.0).
- predis/predis: Use the predis driver for the optional Redis upload journal.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-13 17:16:42 UTC
README
Filoquent
File attributes for Eloquent with upload variants and indexed storage ownership.
Filoquent connects Laravel filesystems to Eloquent attributes. Assign an uploaded file, local path, or stream, then save the model. Middleware can produce named variants. An indexed ownership ledger coordinates replacement and permanent deletion.
Requires PHP ^8.5 and Laravel 13. Version 1.0.0-beta.2 is the published beta. APIs may change before the stable release. From your Laravel application's root, install the published version from Packagist:
composer require artisan-toolbox/filoquent:1.0.0-beta.2 php artisan migrate
Add a nullable JSON column using $table->filoquent('attachment')->nullable() and configure its model:
use ArtisanToolbox\Filoquent\Casts\AsFile; use ArtisanToolbox\Filoquent\Concerns\HasFiloquent; use Illuminate\Database\Eloquent\Model; class Document extends Model { use HasFiloquent; protected function casts(): array { return ['attachment' => AsFile::class]; } } $source = storage_path('app/filoquent-example.txt'); file_put_contents($source, 'Hello Filoquent'); $document = new Document; $document->attachment = $source; $document->save(); dump($document->attachment->default()->exists());
The dump is true.
Run the installation guide to create the example table and configure writable storage. File metadata retains its saved disk and path across cast changes. Soft deletes retain files. The garbage collector reconciles committed receipts after manual row or column deletion. Optional Redis recovery tracks interrupted writes. Objects without a SQL receipt or Redis intent remain outside automatic discovery.
Read the documentation, contributing guide, security policy, changelog, and MIT license.