From b878f1995acb91e2f59d6137b39c6aa595e14c88 Mon Sep 17 00:00:00 2001 From: Andy Swick Date: Sun, 24 May 2026 10:40:46 -0500 Subject: [PATCH] Install Laravel Pennant --- README.md | 1 + app/Features/Inventory.php | 16 ++++ app/Features/Recipes.php | 16 ++++ composer.json | 1 + composer.lock | 78 ++++++++++++++++++- config/pennant.php | 44 +++++++++++ ...026_05_22_195355_create_features_table.php | 26 +++++++ 7 files changed, 181 insertions(+), 1 deletion(-) create mode 100644 app/Features/Inventory.php create mode 100644 app/Features/Recipes.php create mode 100644 config/pennant.php create mode 100644 database/migrations/2026_05_22_195355_create_features_table.php diff --git a/README.md b/README.md index 8771eab..3179046 100644 --- a/README.md +++ b/README.md @@ -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) - [nunomaduro/essentials](https://github.com/nunomaduro/essentials) **Notible NPM Packages:** diff --git a/app/Features/Inventory.php b/app/Features/Inventory.php new file mode 100644 index 0000000..e2f971c --- /dev/null +++ b/app/Features/Inventory.php @@ -0,0 +1,16 @@ + 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', + ], + + ], +]; diff --git a/database/migrations/2026_05_22_195355_create_features_table.php b/database/migrations/2026_05_22_195355_create_features_table.php new file mode 100644 index 0000000..65688c5 --- /dev/null +++ b/database/migrations/2026_05_22_195355_create_features_table.php @@ -0,0 +1,26 @@ +id(); + $table->string('name'); + $table->string('scope'); + $table->text('value'); + $table->timestamps(); + + $table->unique(['name', 'scope']); + }); + } + + public function down(): void + { + Schema::dropIfExists('features'); + } +};