{"title":"\u3010Laravel\u3011whereIn \u30e1\u30bd\u30c3\u30c9\u3067\u751f\u6210\u3055\u308c\u308bIN\u53e5\u306e\u4e2d\u306b\u30b5\u30d6\u30af\u30a8\u30ea\u3092\u66f8\u304f","url":"https://natsuhide.hatenablog.com/entry/2023/03/17/171313","description":"\u554f\u984c \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8907\u6570\u306eID\u3092\u6307\u5b9a\u3057\u3066\u4e00\u62ec\u3067\u66f4\u65b0\u3057\u305f\u3044\u5834\u9762\u304c\u3042\u308a\u307e\u3057\u305f\u3002 $divIds = Div::where('hoge_flg', true)->select('id')->get(); User::whereIn('div_id', $ids)->update(['hoge_flg' => true]); \u305f\u3060\u3001\u4e0a\u8a18\u306e\u3088\u3046\u306b\u66f8\u304f\u30682\u56de\u30af\u30a8\u30ea\u304c\u767a\u884c\u3055\u308c\u308b\u306e\u3067\u3042\u307e\u308a\u826f\u304f\u306a\u3044\u306a\u3068\u601d\u3044\u307e\u3057\u305f\u3002 Div \u30e2\u30c7\u30eb\u306e ID \u3092\u53d6\u5f97\u3059\u308b User \u30e2\u30c7\u30eb\u306e\u30d5\u30e9\u30b0\u3092\u66f4\u65b0\u3059\u308b \u305d\u3053\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306a SQL \u304c\u751f\u6210\u3055\u308c\u308b\u3088\u3046\u306a Eloquent \u304c\u306a\u3044\u304b\u8abf\u3079\u3066\u307f\u307e\u3057\u305f\u3002 update user_table \u2026","provider_url":"https://hatena.blog","blog_url":"https://natsuhide.hatenablog.com/","version":"1.0","blog_title":"\u3072\u3067\u30e1\u30e2","author_name":"natsuhide9221","author_url":"https://blog.hatena.ne.jp/natsuhide9221/","provider_name":"Hatena Blog","image_url":null,"categories":["Laravel"],"published":"2023-03-17 17:13:13","width":"100%","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnatsuhide.hatenablog.com%2Fentry%2F2023%2F03%2F17%2F171313\" title=\"\u3010Laravel\u3011whereIn \u30e1\u30bd\u30c3\u30c9\u3067\u751f\u6210\u3055\u308c\u308bIN\u53e5\u306e\u4e2d\u306b\u30b5\u30d6\u30af\u30a8\u30ea\u3092\u66f8\u304f - \u3072\u3067\u30e1\u30e2\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","type":"rich","height":"190"}