Pennant Features
When to Apply
Activate this skill when:
Creating or checking feature flags
Managing feature rollouts
Implementing A/B testing
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')
pennant-development
安装
npx skills add https://github.com/laravel/boost --skill pennant-development