@php $callId = $entry->calls->first()?->id; $entryId = $entry->getKey(); if ($callId) { $messageUrl = route('message', [ 'call_id' => $callId, 'prescription_id' => $entry->id, ]); $prescription = \App\Models\AiPrescription::find($entry->id); $pivot = $prescription->calls()->wherePivot('call_id', $callId)->first(); $textBackNumber = $pivot->pivot->text_back_number; } else { $messageUrl = "#"; $textBackNumber = null; } // $url = "abc"; @endphp @if ( $textBackNumber ) Ready for collect and Send SMS @endif