Skip to content

Commit 5d68b28

Browse files
committed
Add Pennant
1 parent 3346ed5 commit 5d68b28

File tree

4 files changed

+155
-1
lines changed

4 files changed

+155
-1
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"guzzlehttp/guzzle": "^7.2",
1717
"laravel/cashier": "^15.6",
1818
"laravel/framework": "^10.10",
19+
"laravel/pennant": "^1.18",
1920
"laravel/sanctum": "^3.3",
2021
"laravel/tinker": "^2.8",
2122
"league/commonmark": "^2.4",

composer.lock

Lines changed: 78 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/pennant.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Default Pennant Store
8+
|--------------------------------------------------------------------------
9+
|
10+
| Here you will specify the default store that Pennant should use when
11+
| storing and resolving feature flag values. Pennant ships with the
12+
| ability to store flag values in an in-memory array or database.
13+
|
14+
| Supported: "array", "database"
15+
|
16+
*/
17+
18+
'default' => env('PENNANT_STORE', 'database'),
19+
20+
/*
21+
|--------------------------------------------------------------------------
22+
| Pennant Stores
23+
|--------------------------------------------------------------------------
24+
|
25+
| Here you may configure each of the stores that should be available to
26+
| Pennant. These stores shall be used to store resolved feature flag
27+
| values - you may configure as many as your application requires.
28+
|
29+
*/
30+
31+
'stores' => [
32+
33+
'array' => [
34+
'driver' => 'array',
35+
],
36+
37+
'database' => [
38+
'driver' => 'database',
39+
'connection' => null,
40+
'table' => 'features',
41+
],
42+
43+
],
44+
];
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
use Illuminate\Database\Schema\Blueprint;
4+
use Illuminate\Support\Facades\Schema;
5+
use Laravel\Pennant\Migrations\PennantMigration;
6+
7+
return new class extends PennantMigration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::create('features', function (Blueprint $table) {
15+
$table->id();
16+
$table->string('name');
17+
$table->string('scope');
18+
$table->text('value');
19+
$table->timestamps();
20+
21+
$table->unique(['name', 'scope']);
22+
});
23+
}
24+
25+
/**
26+
* Reverse the migrations.
27+
*/
28+
public function down(): void
29+
{
30+
Schema::dropIfExists('features');
31+
}
32+
};

0 commit comments

Comments
 (0)