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');
}


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3mE1vU4
via IFTTT

Aucun commentaire:

Enregistrer un commentaire