Follow up: I have the following Models...
Game
namespace App;
use Illuminate\Database\Eloquent\Model;
class Game extends Model
{
public function users()
{
return $this->belongsToMany(User::class);
}
public function scores()
{
return $this->hasMany(Scores::class);
}
public function developer()
{
return $this->belongsTo(Developer::class);
}
}
User
class User extends Authenticatable
{
/* removed unrequired bits from this listing */
public function userGames()
{
return $this->hasMany(UserGame::class);
}
public function scores()
{
return $this->hasManyThrough(Score::class, GameUser::class);
}
}
Score
namespace App;
use Illuminate\Database\Eloquent\Model;
class Score extends Model
{
//
public function gameUser()
{
return $this->belongsTo(GameUser::class);
}
public function user()
{
return $this->belongsTo(User::class);
}
public function game()
{
return $this->belongsTo(Game::class);
}
}
GameUser
namespace App;
use Illuminate\Database\Eloquent\Model;
class GameUser extends Model
{
//
public function user(){
return $this->belongsTo(User::class);
}
public function game(){
return $this->belongsTo(Game::class);
}
public function scores(){
return $this->hasMany(Score::class);
}
}
I am getting the score, but no user (thus no name) and no game (and thus no game name).