Laravel launched Pennant, a feature flag package, alongside version 10.x of the framework.
Pennant raises events when resolving a known feature, so the Bugsnag package could hook in to this event and automatically declare a feature flag, as documented here: https://docs.bugsnag.com/platforms/php/laravel/features-experiments/
Code would look something like this:
$events->listen('Laravel\Pennant\Events\FeatureResolved', function ($event) {
$this->app->bugsnag->addFeatureFlag($event->feature, $event->value);
});
It should probably be wrapped in a conditional so that developers can choose to enable or disable this automatically capturing of feature flag values, though. Maybe an environment variable-backed configuration value like BUGSNAG_CAPTURE_PENNANT_FEATURES or something.
Happy to code this up and open a PR if it’s something that would be welcomed in the package.
Laravel launched Pennant, a feature flag package, alongside version 10.x of the framework.
Pennant raises events when resolving a known feature, so the Bugsnag package could hook in to this event and automatically declare a feature flag, as documented here: https://docs.bugsnag.com/platforms/php/laravel/features-experiments/
Code would look something like this:
It should probably be wrapped in a conditional so that developers can choose to enable or disable this automatically capturing of feature flag values, though. Maybe an environment variable-backed configuration value like
BUGSNAG_CAPTURE_PENNANT_FEATURESor something.Happy to code this up and open a PR if it’s something that would be welcomed in the package.