diff --git a/.features.php.dist b/.features.php.dist
new file mode 100644
index 00000000..f01f78f8
--- /dev/null
+++ b/.features.php.dist
@@ -0,0 +1,24 @@
+
+ */
+return static function (Application $app): array {
+ return [
+ 'change.country' => false,
+ 'change.language' => true,
+
+ 'news' => false,
+ 'courses' => false,
+ 'library' => false,
+ 'events' => true,
+ 'bookcases' => false,
+ 'meetups' => true,
+ 'association' => false,
+
+ 'nostr.groups' => false,
+ 'nostr.plebs' => false,
+ ];
+};
diff --git a/.gitignore b/.gitignore
index b8d1caae..f634a7d5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,3 +30,5 @@ yarn-error.log
!.yarn/releases
.blueprint
+
+.features.php
diff --git a/app/Http/Livewire/Bindle/Gallery.php b/app/Http/Livewire/Bindle/Gallery.php
index 5eb9d097..5305ebee 100644
--- a/app/Http/Livewire/Bindle/Gallery.php
+++ b/app/Http/Livewire/Bindle/Gallery.php
@@ -14,19 +14,12 @@ class Gallery extends Component
public function mount()
{
- $this->bindles = LibraryItem::query()
- ->where('type', 'bindle')
- ->latest('id')
- ->get();
+ $this->bindles = LibraryItem::searchLibraryItems('bindle');
}
public function updatedSearch($value)
{
- $this->bindles = LibraryItem::query()
- ->where('type', 'bindle')
- ->where('name', 'ilike', "%{$value}%")
- ->latest('id')
- ->get();
+ $this->bindles = LibraryItem::searchLibraryItems('bindle', $value);
}
public function deleteBindle($id)
diff --git a/app/Models/LibraryItem.php b/app/Models/LibraryItem.php
index bb732586..784e3600 100644
--- a/app/Models/LibraryItem.php
+++ b/app/Models/LibraryItem.php
@@ -164,4 +164,17 @@ class LibraryItem extends Model implements HasMedia, Sortable, Feedable
->link(url()->route('article.view', ['libraryItem' => $this]))
->authorName($this->lecturer->name);
}
+
+ public static function searchLibraryItems($type, $value = null)
+ {
+ $query = self::query()
+ ->where('type', $type)
+ ->latest('id');
+
+ if ($value) {
+ $query->where('name', 'ilike', "%{$value}%");
+ }
+
+ return $query->get();
+ }
}
diff --git a/composer.json b/composer.json
index e3ee8309..2f691514 100644
--- a/composer.json
+++ b/composer.json
@@ -65,6 +65,7 @@
"symfony/mailgun-mailer": "^6.2",
"wesselperik/nova-status-field": "^2.1",
"wireui/wireui": "^1.17.9",
+ "ylsideas/feature-flags": "^2.0",
"ziffmedia/nova-select-plus": "^2.0"
},
"require-dev": {
diff --git a/composer.lock b/composer.lock
index 1f8c76cb..254398d0 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "2c9601391937e04775f009c27b16b988",
+ "content-hash": "70c5fa8fde773985983d2761e278c402",
"packages": [
{
"name": "akuechler/laravel-geoly",
@@ -14560,6 +14560,84 @@
],
"time": "2023-10-25T05:42:02+00:00"
},
+ {
+ "name": "ylsideas/feature-flags",
+ "version": "v2.4.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/ylsideas/feature-flags.git",
+ "reference": "39baec4645098c3d5bc52d4e5c3c5b2bc4204f94"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/ylsideas/feature-flags/zipball/39baec4645098c3d5bc52d4e5c3c5b2bc4204f94",
+ "reference": "39baec4645098c3d5bc52d4e5c3c5b2bc4204f94",
+ "shasum": ""
+ },
+ "require": {
+ "illuminate/contracts": "10.*|^9.6",
+ "php": "^8.1"
+ },
+ "require-dev": {
+ "laravel/pint": "^1.2",
+ "nunomaduro/collision": "^6.0|^5.0",
+ "nunomaduro/larastan": "^2.0|^1.0",
+ "orchestra/testbench": "^8.0|^7.0",
+ "pestphp/pest": "^1.21",
+ "pestphp/pest-plugin-laravel": "^1.1",
+ "phpstan/extension-installer": "^1.1",
+ "phpstan/phpdoc-parser": "^1.15",
+ "phpstan/phpstan-deprecation-rules": "^1.0",
+ "phpstan/phpstan-phpunit": "^1.0",
+ "phpunit/phpunit": "^9.5.13",
+ "rector/rector": "^0.14.2",
+ "spatie/laravel-ray": "^1.26"
+ },
+ "type": "library",
+ "extra": {
+ "laravel": {
+ "providers": [
+ "YlsIdeas\\FeatureFlags\\FeatureFlagsServiceProvider"
+ ],
+ "aliases": {
+ "Features": "YlsIdeas\\FeatureFlags\\Facades\\Features"
+ }
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "YlsIdeas\\FeatureFlags\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Peter Fox",
+ "email": "peter.fox@ylsideas.co",
+ "role": "Developer"
+ }
+ ],
+ "description": "A Laravel package for handling feature flags",
+ "homepage": "https://github.com/ylsideas/feature-flags",
+ "keywords": [
+ "feature-flags",
+ "ylsideas"
+ ],
+ "support": {
+ "issues": "https://github.com/ylsideas/feature-flags/issues",
+ "source": "https://github.com/ylsideas/feature-flags/tree/v2.4.2"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/peterfox",
+ "type": "github"
+ }
+ ],
+ "time": "2023-12-01T18:56:48+00:00"
+ },
{
"name": "zbateson/mail-mime-parser",
"version": "2.4.0",
diff --git a/config/features.php b/config/features.php
new file mode 100644
index 00000000..1bb17143
--- /dev/null
+++ b/config/features.php
@@ -0,0 +1,51 @@
+ ['database', 'in_memory'],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Gateways
+ |--------------------------------------------------------------------------
+ |
+ | Configures the different gateway options
+ |
+ */
+
+ 'gateways' => [
+ 'in_memory' => [
+ 'file' => env('FEATURE_FLAG_IN_MEMORY_FILE', '.features.php'),
+ 'driver' => 'in_memory',
+ ],
+ 'database' => [
+ 'driver' => 'database',
+ 'cache' => [
+ 'ttl' => 600,
+ ],
+ 'connection' => env('FEATURE_FLAG_DATABASE_CONNECTION'),
+ 'table' => env('FEATURE_FLAG_DATABASE_TABLE', 'features'),
+ ],
+ 'gate' => [
+ 'driver' => 'gate',
+ 'gate' => env('FEATURE_FLAG_GATE_GATE', 'feature'),
+ 'guard' => env('FEATURE_FLAG_GATE_GUARD'),
+ 'cache' => [
+ 'ttl' => 600,
+ ],
+ ],
+ 'redis' => [
+ 'driver' => 'redis',
+ 'prefix' => env('FEATURE_FLAG_REDIS_PREFIX', 'features'),
+ 'connection' => env('FEATURE_FLAG_REDIS_CONNECTION', 'default'),
+ ],
+ ],
+];
diff --git a/database/migrations/2023_12_08_201800_create_features_table.php b/database/migrations/2023_12_08_201800_create_features_table.php
new file mode 100644
index 00000000..b389d151
--- /dev/null
+++ b/database/migrations/2023_12_08_201800_create_features_table.php
@@ -0,0 +1,34 @@
+bigIncrements('id');
+ $table->string('title')->nullable();
+ $table->string('feature')->unique();
+ $table->text('description')->nullable();
+ $table->timestamp('active_at')->nullable();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('features');
+ }
+}
diff --git a/resources/views/livewire/bitcoin-event/bitcoin-event-table.blade.php b/resources/views/livewire/bitcoin-event/bitcoin-event-table.blade.php
index 1c0a2b7e..a7b16b01 100644
--- a/resources/views/livewire/bitcoin-event/bitcoin-event-table.blade.php
+++ b/resources/views/livewire/bitcoin-event/bitcoin-event-table.blade.php
@@ -156,6 +156,7 @@
{{-- FOOTER --}}