I have 3 tables
User, Profile, Subscription
subscribers table has a field to flag active/inactive state
Relation are set as
User
public function profile(){
return $this->hasOne('App\Profile');
}
public function subscription(){
return $this->hasOne('App\Subscriber');
}
Profile
public function user(){
return $this->belongsTo('App\User');
}
Susbcriber
public function subscriber() {
return $this->belongsTo('App\User');
}
I want to get the details of active subscribers with
Subscriber::with('subscriber')
->where('active', '=', '1')
->where('digital', '=', '1')
->get();
it only has details from User and Subscriber table, how do i also
connect with Profile table also?