Answer the question
In order to leave comments, you need to log in
How to write an Eloquent query correctly?
Something I can not understand at all how to make the correct Eloquent request. Tell me please.
There are 2 tables:
Users :
id_users
login_users
kingdom_game
id_kingdom
title_kingdom
name_kingdom
Route::group(['prefix' => 'kingdom'], function(){
...
Route::get('{kingdomName}/players', ['as' => 'Kingdom.players', 'uses' => '[email protected]']);
});
Answer the question
In order to leave comments, you need to log in
Kingdom::select(users.id_users, users.login_users)
->leftJoin('users', 'kingdom.id_kingdom', '=', 'users.kingdom_game')
->where('name_kingdom', $nameKingdom)
->get();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question