今日やったこと
アプリに良いね数をカウントして表示する機能と、自分の投稿に良いねできない制限を加えた。
・エラー1
if ($dislike_exist) {
return false;
} else {
if($like_exist) {
$this->liked_cards()->detach($card_id);
return true →変なところにこれを入れてたせいで以下の処理が行われないエラーに。
}
$this->disliked_cards()->attach($card_id);
return true;
}