Laravel Service Container: Service Container: Tagging
Service Container: Tagging
Once the services have been tagged, you may easily resolve them all via the tagged method.
$this->app->bind('SpeedReport', function () {
//
});
$this->app->bind('MemoryReport', function () {
//
});
$this->app->tag(['SpeedReport', 'MemoryReport'], 'reports'); $this->app->bind('ReportAggregator', function ($app) {
return new ReportAggregator($app->tagged('reports'));
});
Semantic portal