egulias/tag-debug-command-bundle
php artisan package:discover, php artisan container:debug), this package offers Symfony-specific tag inspection, which lacks a direct equivalent in Laravel’s ecosystem.ServiceProvider and bind()/singleton() methods, along with app()->tagged() (if using a package like laravel-tagging), provide similar functionality without requiring external bundles.ContainerAwareCommand and ContainerInterface.TaggedIterator and TaggedServiceReference.Symfony\Component\Console).Artisan and Container classes to replicate tag inspection, but this would require custom development.Laravel\Foundation\Application and Illuminate\Container\Container).Why Symfony-Specific?
app()->tagged() (if using a compatible package) or manual inspection?Debugging Gaps in Laravel
php artisan container:debug) that this package addresses?Long-Term Viability
Performance Impact
app()->services) provide sufficient performance?ContainerInterface vs. Laravel’s Illuminate\Container\Container.Command vs. Laravel’s Artisan commands.tagged_iterator vs. Laravel’s lack of native tagging (unless using a third-party package like spatie/laravel-tagging).php artisan container:debug for service inspection.spatie/laravel-tagging), build a custom Artisan command leveraging app()->tagged().Option 1: No Integration (Recommended)
Option 2: Custom Laravel Command (Low Effort)
// app/Console/Commands/TagDebugCommand.php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Spatie\Tagging\Tagged;
class TagDebugCommand extends Command
{
protected $signature = 'debug:tags {--model= : Model to inspect}';
public function handle()
{
$model = app($this->option('model'));
$tags = $model->tags;
$this->table(['Tag Name', 'Tagged Models'], $tags->map(fn($tag) => [$tag->name, $tag->pivot->count()]));
}
}
Option 3: Fork and Adapt (High Risk)
| Dependency | Laravel Equivalent | Compatibility |
|---|---|---|
Symfony\Component\Console |
Illuminate\Console |
Low |
Symfony\Component\DependencyInjection |
Illuminate\Container |
Low |
TaggedIterator |
None (unless using a package) | None |
app()->bind()/app()->tagged() (if using spatie/laravel-tagging).app()->services or app()->makeWith() for manual tagging.spatie/laravel-tagging).spatie/laravel-tagging).container:tag-debug may scan all services, which could be slow in large applications.app()->services) are optimized for Laravel’s container.| Scenario | Impact (No Integration) | Impact (Custom Command) | Impact (Forked Package) |
|---|---|---|---|
| Symfony updates break fork | N/A | N/A | High (fork becomes obsolete) |
| Laravel version incompatibility | N/A | Low (custom code may need updates) | High (Symfony vs. Laravel DI conflicts) |
| Tagging package changes | N/A | Medium (custom logic may break) | N/A |
| Debugging tool becomes unused | N/A | Low (can be removed) | High (wasted effort) |
How can I help you explore Laravel packages today?