public function getUser(Request $request)
{
$user = User::where('steamid',$request->name)->first();
$category = $this->getCategoryUser($user->id);
return view('layouts/panel', compact('user','category'));
}
public function getCategoryUser($id)
{
$category = User::find($id)->category;
return $category;
}
return $this->belongsToMany('App\Category','category_users')->withPivot('id');
$var->pivot->id