Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Nova Pennant

Nova Pennant Laravel Package

laravel/nova-pennant

Manage Laravel Pennant feature flags in Laravel Nova. Add the PennantTool to a resource to view and toggle features per scope, control who can modify values with canRun(), require password confirmation, and support rich/class-based feature options.

View on GitHub
Deep Wiki
Context7

A Pennant Resource Tool for Laravel Nova

Frequently asked questions about Nova Pennant
How do I add the PennantTool to a Laravel Nova resource like User?
Add `PennantTool::make()` to your resource’s `fields()` method. For example, include it alongside other fields like `ID::make()` or `Text::make('Name')`. The tool will appear in Nova’s resource detail view for managing feature flags.
What Laravel and Nova versions does `laravel/nova-pennant` support?
The package requires **Laravel 8+ or 9+** and **Nova 4.x+**. Check the package’s `composer.json` for exact version constraints, as compatibility may vary with minor updates. Older versions may need adjustments.
Can I restrict who can toggle feature flags in Nova?
Yes. Use the `canRun()` method to define authorization logic. For example, restrict toggling to admins with `->canRun(fn ($request) => Nova::user($request)->admin)`. This leverages Nova’s built-in user system.
Does this package work without Pennant installed?
No. `laravel/nova-pennant` is a **Nova UI layer** for Pennant’s feature flags. You must first install `pennant/pennant` via Composer and configure feature flags in your Laravel app before using this tool.
How do I require password confirmation for toggling flags?
Call `->requiresConfirmPassword()` on the `PennantTool::make()` method. This adds a password confirmation step before allowing users to activate or deactivate features, enhancing security.
Can I use rich feature values (e.g., dropdowns) in Nova?
Yes, if your Pennant feature uses a **class-based definition** with an `options()` method. The tool will automatically render the values as a dropdown or select input in Nova’s UI for that scope.
Will adding PennantTool slow down Nova’s performance?
Minimal impact is expected, but Pennant evaluations are still executed. For large-scale apps, cache Pennant results using Laravel’s cache or Pennant’s built-in caching to reduce latency in Nova.
Can I integrate this with a custom Nova resource, not just User?
Absolutely. Add `PennantTool::make()` to any Nova resource’s `fields()` method. It’s designed to work flexibly across resources like `Settings`, `Team`, or even custom models.
Are there alternatives to `laravel/nova-pennant` for managing feature flags in Nova?
If you’re not using Pennant, consider **Laravel’s built-in feature flags** or third-party packages like `spatie/laravel-feature-flags` with custom Nova tools. However, `nova-pennant` is the official bridge for Pennant users.
How do I test PennantTool in my Nova application?
Test by mocking Pennant evaluations in your Nova resource tests. Verify that toggling flags updates Pennant correctly and that authorization (e.g., `canRun()`) blocks unauthorized users. Use Nova’s testing helpers like `actingAs()` for user context.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport