Purchased Subjects

@php $uniqueSubjects = []; // Array to store unique subject_ids @endphp @foreach ($subjectlist as $subject) @if (!in_array($subject->subjectid, $uniqueSubjects)) {{-- Display card only if subject_id is not already in the array --}}
Fissure in Sandstone
{{ $subject->subjectname }}

Tutor: {{ $subject->tutorname }}

Purchased On: {{ $subject->payment_date }}

View
@php $uniqueSubjects[] = $subject->subjectid; // Add subject_id to the array @endphp @endif @endforeach
@endsection