Skip to content

Instantly share code, notes, and snippets.

@leben-jp
Created November 14, 2021 18:38
Show Gist options
  • Save leben-jp/bbce023368d9b63995aa03790102d8b8 to your computer and use it in GitHub Desktop.
Save leben-jp/bbce023368d9b63995aa03790102d8b8 to your computer and use it in GitHub Desktop.
//view_countを一つカウントアップする
Post::find($post_id)->increment('view_count');
//ポイントを50加算する
User::find($user_id)->increment('points', 50);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment