Skip to content

Instantly share code, notes, and snippets.

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