Beautiful Open-Source Form Builder
Refactor closures in FormController and PaymentBlockConfigurationRule for consistency
Julien Nahum14df5143fece
diff --git a/api/app/Http/Controllers/Forms/FormController.php b/api/app/Http/Controllers/Forms/FormController.phpindex 1128aacad..8c649f03b 100644--- a/api/app/Http/Controllers/Forms/FormController.php+++ b/api/app/Http/Controllers/Forms/FormController.php@@ -52,7 +52,7 @@ class FormController extends Controller'updated_at',])->with(['workspace'])- ->withCount(['submissions as submissions_count' => fn($q) => $q->where('status', FormSubmission::STATUS_COMPLETED)])+ ->withCount(['submissions as submissions_count' => fn ($q) => $q->where('status', FormSubmission::STATUS_COMPLETED)])->withTotalViews()->orderByDesc('updated_at')->paginate(10);diff --git a/api/app/Rules/PaymentBlockConfigurationRule.php b/api/app/Rules/PaymentBlockConfigurationRule.phpindex ab690537f..f485649b3 100644--- a/api/app/Rules/PaymentBlockConfigurationRule.php+++ b/api/app/Rules/PaymentBlockConfigurationRule.php@@ -44,7 +44,7 @@ class PaymentBlockConfigurationRule implements ValidationRule// Only one payment block allowed$paymentBlocks = collect($this->properties)- ->filter(fn($prop) => $prop['type'] === 'payment')+ ->filter(fn ($prop) => $prop['type'] === 'payment')->count();if ($paymentBlocks > 1) {