You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
useApp\Features\Foobar;
useLaravel\Pennant\Feature;
// ...Feature::define(Foobar::class);
Feature::active('foobar'); // true, as expectedFeature::values([ 'foobar' ]); // [ 'foobar' => true ], as expectedFeature::values([ Foobar::class ]); // [ 'App\Features\Foobar' => true ], I would rather this use the given name, 'foobar'
My use case is that I want to use Foobar::class internally. It's easier for other members of the team to quickly jump to the feature and see what it is. However, I also want to dump a whole lot of features out into an API, so the frontend can ingest it, and I want a simpler name to be used there.
A workaround on my end could be to make $name get it's value from a const, and use that const in values
When calling
values
, it doesn't use the given name of class-based features when the key given is the class name.app/Features/FooBar.php
Usage
My use case is that I want to use Foobar::class internally. It's easier for other members of the team to quickly jump to the feature and see what it is. However, I also want to dump a whole lot of features out into an API, so the frontend can ingest it, and I want a simpler name to be used there.
A workaround on my end could be to make $name get it's value from a const, and use that const in values
But it feels to me that it maybe shouldn't work this way. I'm not sure if it's a bug.
The text was updated successfully, but these errors were encountered: