@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.
Referral contacts I added
| ID |
Name |
Phone |
Status |
Added At |
@forelse ($studentReferralContacts as $contact)
@php
$isConverted = in_array($contact->status, ['converted', 'lead', 'converted_to_lead'], true);
$statusLabel = ucfirst(str_replace('_', ' ', $contact->status));
@endphp
| {{ $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' }} |
@empty
|
No referral contacts added yet.
|
@endforelse
Referral made for me
| ID |
Referred By |
Used? |
@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
| {{ $referral->id }} |
{{ $referrerName ?: 'N/A' }} |
{{ $isUsed ? 'Used' : 'Not used' }}
|
@empty
|
No referral was made for you.
|
@endforelse
My referrals
| ID |
Referred Student |
Used? |
@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
| {{ $referral->id }} |
{{ $referredName ?: 'N/A' }} |
{{ $isUsed ? 'Used' : 'Not used' }}
|
@empty
|
You have not referred anyone yet.
|
@endforelse