/** * @param $user */ public function unfollow($user) { if (is_a($user, Follow::userModel())) { $user = $user->id; } $this->followings()->detach($user); }
/** * Reverse the migrations. * * @return void */ public function down() { Schema::drop(Follow::pivotTable()); }