Vishaal
6 months ago

Foreach profiel data

Posted 6 months ago by Vishaal

Hello,

I have create seperate table for profile data now i want to foreach this with model but i'm getting problem with this.

When i'm try to foreach this i'm getting only the users name with that content in that row. How can I foreach with where statement like specify user.

HTML code is in model.

Userid on blade: {{$users->id}}


$user_id = User::role(['Surveillant - accept', 'Surveillant - profiel'])->pluck('id');
        $users = User::find($user_id);

        $profiel = DB::table('surveillanten')
                   ->whereIn('user_id', $user_id)
                   ->get();

@foreach($profiel as $profiels)

<div class="col col-lg-6"><input type="text" class="form-control" name="voornaam" value="{{$profiels->roepnaam}}" readonly></div>
@endforeach

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