Laravel 5.1 relationships, Have users ids, but i dont have they usernames -
i'm novice i'm trying build 1 way friendlist relationship, can see userid of users, need usernames, problem is, these ids coming relationship table "friends" results of query, doesn't have usernames, instead stores users_id. this get! here config *usuarios stands users* table usuarios: id->primary username friends table: id->primary user_id->reference->users.id friend_id->reference->users.id user model: public function friends() { return $this->belongstomany('app\user', 'friends', 'user_id', 'friend_id'); } now routes: /* single user id */ route::get('user/{usuario}', function($usuario) { $usuario = db::table('usuarios')->where('username', $usuario)->first(); $friends = db::table('friends')->where('user_id', '=', $usuario->id)->get(); return view('users.profile') ->with('friends', $fr...