@extends('adminlte::page') @section('title', 'Assign Students') @section('content_header')

Assign Students to Subject: {{ $subject->name }}

@stop @section('content')
@if(session('success'))
{{ session('success') }}
@endif
@csrf @method('PUT') @foreach($classes as $class)
@php $classStudents = $students->where('class_id', $class->id); @endphp @foreach($classStudents as $student) @php $assigned = isset($pivotData[$student->id]) && $pivotData[$student->id] == 0; @endphp @endforeach
Student Assigned
{{ $student->first_name }} {{ $student->last_name }} @if($assigned) @else @endif
@endforeach
@stop @section('js') @stop