Ap3twe
324
16
Laravel

How do I pass 2 arguments in foreach ?

Posted 2 months ago by Ap3twe

Am getting an error How do I put the $project

@foreach ($users as $users)
    
     <table class="table table-striped table-bordered" id="table_id">
            <thead>
                    <tr>
                            <th>Case Number</th>
                            <th>Case Form</th>
                            <th>Patient Name</th>
                            <th>Date Created</th>
                            <th>Status</th>
                    </tr>
            </thead>
            @foreach ($project as $project)
            <tbody>
              
             <tr>
                
                 <td> <a href="/smiledesign/{{$project->id}}/userproject">{{$project->case_number}}</a></td>
                
                 @if ($project->services0)
                 <td> <a href="/smiledesign/{{$project->id}}/userproject">{{$project->services0}}</a></td> 
                 @elseif ($project->services1)
                 <td> <a href="/smiledesign/{{$project->id}}/userproject">{{$project->services1}}</a></td> 
                 @elseif ($project->services2)
                 {{-- <td> <a href="/smiledesign/{{$project->id}}/userproject">{{$project->services2 . '  '  . $project->mockup0}}</a></td>  --}}
                 <td> <a href="/smiledesign/{{$project->id}}/userproject">{{$project->services2 . '  '  . $project->mockup0 . ' ' . $project->mockup1}}</a></td> 

                 @endif
                 <td> <a href="/smiledesign/{{$project->id}}/userproject">{{$project->first_name . ' ' . $project->last_name}}</a></td>
                 <td> <a href="/smiledesign/{{$project->id}}/userproject">{{$project->created_at}}</a></td>
                 <td> <a href="/smiledesign/{{$project->id}}/userproject">{{$project->concerns}}</a></td> 
             </tr>

         </tbody>
         @endforeach

     </table>
         

@endsection

@endforeach  

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

Reply to

Use Markdown with GitHub-flavored code blocks.