<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nakahashi_h</author_name>
  <author_url>https://blog.hatena.ne.jp/nakahashi_h/</author_url>
  <blog_title>websandbag ブログ</blog_title>
  <blog_url>https://blog.websandbag.com/</blog_url>
  <categories>
    <anon>Laravel</anon>
  </categories>
  <description>指定したモデルで管理しているパラメータによって処理を変えたい時があります。 判定に使用するパラメータがbool型であれば、trueかfalseなので特に迷うことはありません。 しかし、int型で複数の状態を管理する場合があります。 int型でパラメータを管理する場合はどの数値がどの状態かを考慮する必要があるため、その内訳は設計（実装）した人にしかわかりません。 数字で指定する必要があるとはいえ、マジックナンバーの使用は避けたいものです。 かといってConfigファイルにまとめると、呼び出す度に長い文になってしまい可読性が落ちます。 if($entry-&gt;status == Config::ge…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.websandbag.com%2Fentry%2F2019%2F08%2F15%2F023349&quot; title=&quot;【Laravel】モデルに判定用の関数を追加してチェーンメソッドで呼び出す - websandbag ブログ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/n/nakahashi_h/20180506/20180506160600.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-08-15 02:33:49</published>
  <title>【Laravel】モデルに判定用の関数を追加してチェーンメソッドで呼び出す</title>
  <type>rich</type>
  <url>https://blog.websandbag.com/entry/2019/08/15/023349</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
