public function followers()
{
return $this->belongsToMany('App\User', 'follower_following', 'following_id', 'follower_id')
->select('id', 'uname', 'name');
}
public function following()
{
return $this->belongsToMany('App\User', 'follower_following', 'follower_id', 'following_id')
->select('id', 'uname', 'name');
}
public function files(){
return $this->hasMany(Files::class)
->orderBy('created_at');
}
как получить файлы пользователя followig
я пробовал этот метод
$file = Files::whereIn('user_id',$followers)
->with('user')
->latest()
->limit(10)
->get();
но показывает неопределенных $ последователей