diff --git a/app/Domains/Contact/ManageRelationships/Web/Controllers/ContactRelationshipsController.php b/app/Domains/Contact/ManageRelationships/Web/Controllers/ContactRelationshipsController.php index c68ad656f55..e93a3b48046 100644 --- a/app/Domains/Contact/ManageRelationships/Web/Controllers/ContactRelationshipsController.php +++ b/app/Domains/Contact/ManageRelationships/Web/Controllers/ContactRelationshipsController.php @@ -45,7 +45,7 @@ public function store(Request $request, string $vaultId, string $contactId) // first, let's create a contact if there is no contact selected $otherContactId = 0; - if ($request->input('choice') != 'contact') { + if ($request->input('choice') !== 'contact') { $otherContact = (new CreateContact())->execute([ 'account_id' => Auth::user()->account_id, 'author_id' => Auth::id(), @@ -61,9 +61,7 @@ public function store(Request $request, string $vaultId, string $contactId) 'template_id' => null, ]); $otherContactId = $otherContact->id; - } - - if ($request->input('choice') == 'contact') { + } else { $otherContactId = collect($request->input('other_contact_id'))->pluck('id')->first(); } @@ -72,8 +70,8 @@ public function store(Request $request, string $vaultId, string $contactId) 'author_id' => Auth::id(), 'vault_id' => $vaultId, 'relationship_type_id' => $request->input('relationship_type_id'), - 'contact_id' => $request->input('base_contact_id') == $contactId ? $contactId : $otherContactId, - 'other_contact_id' => $request->input('base_contact_id') == $contactId ? $otherContactId : $contactId, + 'contact_id' => $request->input('base_contact_id') === $contactId ? $contactId : $otherContactId, + 'other_contact_id' => $request->input('base_contact_id') === $contactId ? $otherContactId : $contactId, ]); return response()->json([ diff --git a/app/Domains/Settings/ManageCallReasons/Web/ViewHelpers/PersonalizeCallReasonsIndexViewHelper.php b/app/Domains/Settings/ManageCallReasons/Web/ViewHelpers/PersonalizeCallReasonsIndexViewHelper.php index f33df5d7bed..4d529c1188a 100644 --- a/app/Domains/Settings/ManageCallReasons/Web/ViewHelpers/PersonalizeCallReasonsIndexViewHelper.php +++ b/app/Domains/Settings/ManageCallReasons/Web/ViewHelpers/PersonalizeCallReasonsIndexViewHelper.php @@ -31,9 +31,7 @@ public static function dtoReasonType(CallReasonType $type): array return [ 'id' => $type->id, 'label' => $type->label, - 'reasons' => $type->callReasons->map(function ($reason) use ($type) { - return self::dtoReason($type, $reason); - }), + 'reasons' => $type->callReasons->map(fn ($reason) => self::dtoReason($type, $reason)), 'url' => [ 'store' => route('settings.personalize.call_reasons.store', [ 'callReasonType' => $type->id, diff --git a/app/Models/CallReason.php b/app/Models/CallReason.php index 8a95240db21..3ddbe285d00 100644 --- a/app/Models/CallReason.php +++ b/app/Models/CallReason.php @@ -42,8 +42,8 @@ public function callReasonType(): BelongsTo protected function label(): Attribute { return Attribute::make( - get: function ($value, $attributes) { - if (! $value) { + get: function (?string $value, array $attributes) { + if ($value === null) { return __($attributes['label_translation_key']); } diff --git a/resources/js/Components/DropdownLink.vue b/resources/js/Components/DropdownLink.vue index 2b05b0d3a0b..7ecc9fe4a5b 100644 --- a/resources/js/Components/DropdownLink.vue +++ b/resources/js/Components/DropdownLink.vue @@ -10,14 +10,14 @@ defineProps({