Weave 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
Laravel Prunable Fields

Laravel Prunable Fields Laravel Package

maize-tech/laravel-prunable-fields

Laravel Prunable Fields lets you mark model attributes as prunable and automatically clear or remove them after a configurable period, with minimal setup. A simple, flexible way to implement data retention policies and GDPR compliance in your Laravel apps.

View on GitHub
Deep Wiki
Context7

Easily clean model fields with a command

Frequently asked questions about Laravel Prunable Fields
How do I install and set up laravel-prunable-fields?
Install it with Composer using composer require maize-tech/laravel-prunable-fields. The package is designed around a published config file and a trait added to each affected Eloquent model, followed by running its pruning command. Check the README for the exact service provider, config publish tag, and command signature because the provided excerpt does not list them.
Which Laravel and PHP versions are supported?
Release 1.3.0 adds Laravel 11 compatibility, and the package's compatibility trajectory targets Laravel 9, 10, and 11 on PHP 8.x. Teams on Laravel 11 should pin to ^1.3. Confirm the PHP floor and the CI-tested Laravel and PHP matrix in composer.json before upgrading, because a package PHP floor above your runtime will block installation.
How does it differ from Laravel's built-in Prunable trait?
Laravel's native Prunable and MassPrunable traits typically remove entire stale model records. laravel-prunable-fields is narrower: it keeps the row and clears or removes designated field values after a retention period. That makes it complementary when the business requirement is to retain the record but destroy sensitive column data.
How do I mark model fields as prunable and set the retention period?
Add the package trait to the model and declare the attributes you want pruned, then set the retention period in the package configuration or per model as documented. The provided overview confirms a trait-plus-config design but does not list the exact config keys or trait properties. Read the published config file and README before wiring production rules.
Does pruning delete field values, set them to null, or anonymize them?
The overview describes the behavior as clearing or removing prunable field values, but the provided material does not confirm whether that means NULL, an empty value, anonymized replacement, or deletion into another store. Treat the operation as destructive until you verify the implementation in source. Test the exact behavior on a staging copy before enabling it on production data.
Can I restore field values after pruning?
No restore path is documented in the provided assessment, and pruning field values is generally irreversible. There is no mention of soft-deletes, a separate archive store, or undo commands. Back up affected columns or export audit evidence before running the command against production.
Does laravel-prunable-fields work with Laravel 11 scheduling?
Version 1.3.0 explicitly adds Laravel 11 compatibility, which removes the main adoption blocker for current Laravel teams. However, Laravel 11 moved scheduling out of ConsoleKernel into routes/console.php and bootstrap files, so framework compatibility does not guarantee the schedule is wired in a fresh skeleton. Verify command registration and schedule discoverability in a throwaway Laravel 11 app.
How does it perform on large tables?
The provided assessment does not specify whether the command prunes in chunks or issues one large UPDATE against the full result set. For large tables, inspect the source for chunkById or batch limits and test against representative row counts. Schedule off-peak and monitor lock contention before using it on high-volume tables.
Does it provide audit logs, events, metrics, or dry-run mode?
Audit logging, model events, metrics, and a dry-run or count-only mode are not described in the provided material. For GDPR evidence, verify what the command emits and consider wrapping it with your own logging or reporting. A staging dry run or count query is prudent before enabling any scheduled pruning.
Is the package actively maintained, and what alternatives exist?
The package appears small and maintained under the maize-tech organization, with 1.3.0 showing Laravel 11 tracking and community contribution, but the provided assessment flags weak bus-factor and release-cadence signals. Alternatives include Laravel's native Prunable traits for whole-record cleanup or custom scheduled anonymization jobs for field-level control. Review the repository's recent commits, issues, and CI before relying on it for compliance-critical retention.
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.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager