@php $studentReferralCode = $student->student_code ?: null; $studentReferralLink = $studentReferralCode ? route('registerForm', ['ref' => $studentReferralCode]) : null; $receivedReferralActivities = $receivedReferralActivities ?? collect(); $sentReferralActivities = $sentReferralActivities ?? collect(); $studentReferralContacts = $student->referralContacts ?? collect(); @endphp
Referrals

Referral records linked to the current student/lead account.

@if ($studentReferralLink)
Share this link with new students. Their registration will be linked to your referral code. @else
No student code found for this profile yet.
@endif
@if ($studentReferralCode)
Share this code with new students. Their registration will be linked to your referral code. @else
No student code found for this profile yet.
@endif
Add referral contact
Add the name and phone number of someone you referred.
@csrf
@error('name')
{{ $message }}
@enderror
@error('phone')
{{ $message }}
@enderror @error('mobile_country_code')
{{ $message }}
@enderror @error('mobile_dial_code')
{{ $message }}
@enderror
Referral contacts I added
@forelse ($studentReferralContacts as $contact) @php $isConverted = in_array($contact->status, ['converted', 'lead', 'converted_to_lead'], true); $statusLabel = ucfirst(str_replace('_', ' ', $contact->status)); @endphp @empty @endforelse
ID Name Phone Status Added At
{{ $contact->id }} {{ $contact->name }} @if ($contact->mobile_dial_code) {{ $contact->mobile_dial_code }} @endif {{ $contact->phone }} @if ($contact->mobile_country_code) ({{ $contact->mobile_country_code }}) @endif {{ $statusLabel }} {{ optional($contact->created_at)->format('Y-m-d') ?? 'N/A' }}
No referral contacts added yet.
Referral made for me
@forelse ($receivedReferralActivities as $referral) @php $referrerName = $referral->userable?->full_name ?? $referral->userable?->name ?? $referral->userable?->email ?? ($referral->lead ? trim($referral->lead->first_name . ' ' . $referral->lead->last_name) : null); $isUsed = !empty($referral->referred_discount_used_at); @endphp @empty @endforelse
ID Referred By Used?
{{ $referral->id }} {{ $referrerName ?: 'N/A' }} {{ $isUsed ? 'Used' : 'Not used' }}
No referral was made for you.
My referrals
@forelse ($sentReferralActivities as $referral) @php $referredName = $referral->referredable?->full_name ?? $referral->referredable?->name ?? $referral->referredable?->email ?? $referral->referred?->full_name ?? null; $isUsed = (string) $referral->is_used === '1'; @endphp @empty @endforelse
ID Referred Student Used?
{{ $referral->id }} {{ $referredName ?: 'N/A' }} {{ $isUsed ? 'Used' : 'Not used' }}
You have not referred anyone yet.