bentools/user-aware-command-bundle
createdBy/updatedBy fields). This aligns well with Laravel’s eloquent auditing (e.g., Ocramius\DoctrineExtensions or laravel-auditable) but lacks direct Laravel equivalents.Command system; Laravel’s Artisan commands differ in structure (e.g., no AppKernel, dependency injection via ServiceProvider/Console/Kernel). Requires abstraction or middleware adaptation.UserAwareCommand trait or Artisan middleware).auditable package + custom Artisan middleware to inject user context.UserAwareCommand interface + service provider to bind a default user).creating, updating) to set created_by/updated_by dynamically in commands.createdBy/updatedBy fields exist. Laravel projects may need schema migrations or trait-based field injection.Command and Kernel systems makes direct Laravel adoption risky without refactoring.--user flag or session context).Why Symfony-Specific?
User Context Strategy
auth()->user() fails in CLI; alternatives: config value, environment variable, or --user flag parsing).--user option) in Laravel?Alternatives Evaluation
laravel-auditable, spatie/activitylog, or custom solutions (e.g., this package).Model::update() calls in commands?Long-Term Maintenance
Command system affect compatibility?laravel-auditable + custom Artisan middleware to inject user context.
UserAwareCommand trait/interfaces.createdBy/updatedBy. Prioritize high-impact commands (e.g., data imports, admin tasks).UserAwareInterface.--user flag for dynamic binding.laravel-auditable and update commands to manually set user fields.
laravel-auditable.created_by/updated_by to models.auth()->user() or pass user via constructor.UserAwareCommand interface.config('audit.default_user')).--user flag.cli-service.symfony.com).Http::post('cli-service/do-my-command', ['user_id' => 1])).laravel-auditable (recommended) or manually add created_by/updated_by fields.laravel-doctrine), the bundle may work as-is.Console outside of commands, but Laravel’s Artisan has a different DI system.composer.json).--user flag or alternative methods.createdBy/updatedBy values in production to ensure correctness.laravel-auditable):
laravel-auditable): Extensive docs, GitHub issues, and Stack Overflow coverage.debug:container to inspect user binding.Log::info('User bound:', ['user' => $this->user])).parallel:for).How can I help you explore Laravel packages today?