Jul 6, 2020
0
Level 10
Building a Social Network with Laravel
We have 4 social networks now.
The user can delete or add.
It shows like this when I want to show it to the admin.
That's four telegrams.
My complete code is ..
blade
<?php
$related = json_decode($user->related_id, true);
$social_name = $social->chump(2);
?>
<div class="table-responsive">
<table class="table table-bordered table-striped">
@foreach($social as $key=>$fieldID)
<tr>
<th>IDh {{ $social_name->name }}</th>
<th>{{ $related[$key] }}</th>
</tr>
@endforeach
</table>
</div>
Controller
public function social(User $user)
{
$socials_ids = json_decode($user->social_id);
$social = Social::whereIn('id', $socials_ids)->get();
return view('Admin.users.socials', compact('user', 'social'));
}
Please or to participate in this conversation.

