5 months ago

ForElse single ouput instead of multipe outputs - problem

Posted 5 months ago by naekobest

Hey there! Im currently trying to get behind why on earth there is only one output in my forelse loop

Thats what it looks like

populated exam table

populated subject table

populated topics table

For each topic belonging to the/an exam i want a list item There should be 2 subjects for exam_id 3 (Vollzugsrecht)


    <main role="main" class="container">
        <div class="container" style="display:inline-flex;">
            <div class="row w-100">
                <div class="col align-items-stretch">
                    <div class="row justify-content-center mt-4">
                        <p class="h1">Einf├╝hrungslehrgang</p>
                    @forelse ($topics as $topic)
                    @if ($topic->subject->exam->lehrgang == 'Einf├╝hrungslehrgang')
                      <div class="col-md-12 mt-4">
                        <div class="card">
                            <div class="card-body">
                                <h5 class="card-title font-weight-bold font-weight-bold">{{ $topic->subject->exam->name }}</h5>
                                <p class="card-text">
                                    <table class="table table-striped">
                                          <td><a href="{{ route('subject') }}/{{ $topic->subject->id }}">{{ $topic->subject->name }}</a></td>
                                          <td><p class="card-text text-right"><small class="text-muted">Stand: {{ $topic->subject->updated_at->format('m/Y') }}</small></p></td>

Please sign in or create an account to participate in this conversation.