1. Go to this page and download the library: Download beacon-hq/pennant-driver library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Laravel\Pennant\Feature;
// Check if a feature is active
if (Feature::active('new-dashboard')) {
// Show new dashboard
}
// Check if a feature is inactive
if (Feature::inactive('legacy-feature')) {
// Hide legacy feature
}
use Laravel\Pennant\Feature;
// Check feature for a specific user
$user = auth()->user();
if (Feature::for($user)->active('premium-features')) {
// Show premium features
}
// Check feature for a team
$team = $user->team;
if (Feature::for($team)->active('team-collaboration')) {
// Enable team collaboration features
}
use Laravel\Pennant\Feature;
// Get feature value (boolean, string, array, etc.)
$config = Feature::value('feature-config');
use Laravel\Pennant\Feature;
// Execute code when feature is active
Feature::when('new-feature', function () {
// Code to run when feature is active
}, function () {
// Code to run when feature is inactive (optional)
});
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.