About pennant-development
A skill for developers using Laravel Pennant to define and manage feature flags. It covers checking flags globally or by scope, Blade directives, activation, and verification across users or entities.
Key features
- 01Define feature flags
- 02Check flags globally or by scope
- 03Use flags in Blade templates
- 04Activate flags globally or by scope
- 05Verify flags across users and scopes
Use cases
- 01Adding a Pennant feature flag
- 02Displaying conditional Blade content
- 03Testing flag behavior for different users
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ laravel/ boost --skill pennant-developmentAfter installing, type/pennant-developmentin Claude Code to confirm it loaded.
Details
From the project READMEPennant features
Documentation
Use search-docs for detailed Pennant patterns and documentation.
Basic usage
Defining features
use Laravel\Pennant\Feature;
Feature::define('new-dashboard', function (User $user) {
return $user->isAdmin();
});
Checking features
if (Feature::active('new-dashboard')) {
// Feature is active
}
// With scope
if (Feature::for($user)->active('new-dashboard')) {
// Feature is active for this user
}
Blade directive
@feature('new-dashboard')
<x-new-dashboard />
@else
<x-old-dashboard />
@endfeature
Activating and deactivating
Feature::activate('new-dashboard');
Feature::for($user)->activate('new-dashboard');
Verification
- Check that the feature flag is defined
- Test with different scopes and users
Common pitfalls
- Forgetting to scope features for specific users or other entities
- Not following existing naming conventions
Comments
Markdown supported