lundi 21 septembre 2020

Laravel 5.4 - Get logged user info with other table (contests) information

Showing right now on PageController

 public function getBlazeTalent() {
    $contestars = DB::table('contests')->where('user_id', Auth::id())->get();
    return view('blazetalent')->withContestars($contestars);
 }

But I want to show current user information with other contestars (users) information.

Contest Model

public function user() {
  return $this->belongsTo('BlazeChannel\User');
}


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire