Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [driftingly/rector-laravel](https://github.com/driftingly/rector-laravel)
- [livewire/flux-pro](https://fluxui.dev/)
- [laravel/boost](https://github.com/laravel/boost)
- [laravel/pennant](https://github.com/laravel/pennant)
- [laravel/pao](https://github.com/laravel/pao)
- [nunomaduro/essentials](https://github.com/nunomaduro/essentials)

Expand Down
16 changes: 16 additions & 0 deletions app/Features/Inventory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace App\Features;

use Laravel\Pennant\Attributes\Name;

#[Name('inventory')]
class Inventory
{
public function resolve(mixed $scope): bool
{
return true;
}
}
16 changes: 16 additions & 0 deletions app/Features/Recipes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace App\Features;

use Laravel\Pennant\Attributes\Name;

#[Name('recipes')]
class Recipes
{
public function resolve(mixed $scope): bool
{
return true;
}
}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"laravel/fortify": "^1.30",
"laravel/framework": "^13.0",
"laravel/nightwatch": "^1.24",
"laravel/pennant": "^1.23",
"laravel/sanctum": "^4.0",
"laravel/tinker": "^3.0",
"league/flysystem-aws-s3-v3": "^3.0",
Expand Down
76 changes: 76 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions config/pennant.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Default Pennant Store
|--------------------------------------------------------------------------
|
| Here you will specify the default store that Pennant should use when
| storing and resolving feature flag values. Pennant ships with the
| ability to store flag values in an in-memory array or database.
|
| Supported: "array", "database"
|
*/

'default' => env('PENNANT_STORE', 'database'),

/*
|--------------------------------------------------------------------------
| Pennant Stores
|--------------------------------------------------------------------------
|
| Here you may configure each of the stores that should be available to
| Pennant. These stores shall be used to store resolved feature flag
| values - you may configure as many as your application requires.
|
*/

'stores' => [

'array' => [
'driver' => 'array',
],

'database' => [
'driver' => 'database',
'connection' => null,
'table' => 'features',
],

],
];
26 changes: 26 additions & 0 deletions database/migrations/2026_05_22_195355_create_features_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Laravel\Pennant\Migrations\PennantMigration;

return new class extends PennantMigration
{
public function up(): void
{
Schema::create('features', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('scope');
$table->text('value');
$table->timestamps();

$table->unique(['name', 'scope']);
});
}

public function down(): void
{
Schema::dropIfExists('features');
}
};
Loading