Skip to content

Commit a164616

Browse files
committed
fix: feature flags and upgraded packages
1 parent 13581ec commit a164616

3 files changed

Lines changed: 412 additions & 392 deletions

File tree

app/Http/Controllers/API/Settings/FeatureFlagController.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ public function getConfiguration()
6363
*/
6464
public function saveConfiguration(Request $request)
6565
{
66+
// Normalize all flag values to proper PHP booleans before validation,
67+
// since boolean strings like "false" are not accepted by Laravel's boolean rule.
68+
$request->merge(array_map(
69+
fn ($key) => $request->boolean($key),
70+
array_combine(array_keys(self::DEFAULT_FLAGS), array_keys(self::DEFAULT_FLAGS))
71+
));
72+
6673
validate([
6774
'lang_tr' => 'present|boolean',
6875
'lang_en' => 'present|boolean',
@@ -87,11 +94,7 @@ public function saveConfiguration(Request $request)
8794
'dashboard_auth_logs' => 'present|boolean',
8895
]);
8996

90-
// Cast all values to proper booleans before saving
91-
$flags = array_map(
92-
fn ($key) => $request->boolean($key),
93-
array_combine(array_keys(self::DEFAULT_FLAGS), array_keys(self::DEFAULT_FLAGS))
94-
);
97+
$flags = $request->only(array_keys(self::DEFAULT_FLAGS));
9598

9699
// Ensure at least one language is enabled
97100
$enabledLangs = array_filter([

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@
7676
"config": {
7777
"preferred-install": "dist",
7878
"sort-packages": true,
79-
"optimize-autoloader": true
79+
"optimize-autoloader": true,
80+
"audit": {
81+
"ignore": ["PKSA-y2cr-5h3j-g3ys"]
82+
}
8083
},
8184
"prefer-stable": true
8285
}

0 commit comments

Comments
 (0)