title: Laravel - Where to store statuses (flags)? Model, Class or config folder?
body: <p>I need to extensively use statuses in mt project. I need them for my <code>users</code> (<code>active</code>, <code>suspended</code>, etc), an entity (<code>active</code>, <code>pending_activation</code>, <code>inactive</code>) and for my subscriptions(<code>active</code>, <code>on_grace_period</code>, <code>not_subscribed</code>, <code>never_subscribed</code>).</p>
  
  <p>So far I thought that the best way is to store them in the DB but i have a feeling it's much easier to have them in the other 3 options.</p>
  
  <p>I also thought that i can store them in my <code>Eloquent</code> Model as constants. For example my subscription model would look like this:</p>
  
  <pre><code>// SubscriptionModel
  const SUBSCRIBED_ACTIVE = 1;
  const SUBSCRIBED_ON_GRACE_PERIOD = 2;
  const NOT_SUBSCRIBED = 3;
  const NEVER_SUBSCRIBED = 4;
  </code></pre>
  
  <p>and retrieving them, for example in a blade view:</p>
  
  <pre><code>// subscription/index.blade.php
  @if($user-&gt;subscription-&gt;status == /App/SubscriptionModel::SUBSCRIBED_ACTIVE)
      &lt;div&gt;You are subscribed. Thank you&lt;/div&gt;
  @elseif($user-&gt;subscription-&gt;status == /App/SubscriptionModel::NEVER_SUBSCRIBED)
      &lt;div&gt;You need to create a subscription before being granted full access!&lt;/div&gt;
  @elseif(...)
      // and so on
  </code></pre>
  
  <p>How about doing the same but using the config folder and adding a file called <code>status.php</code>. Accessing it in the view would be like:  </p>
  
  <pre><code>@if($user-&gt;subscription-&gt;status == Config::get('status.subscription.SUBSCRIBED_ACTIVE'))
  &lt;div&gt;You are subscribed. Thank you&lt;/div&gt;
  @elseif(...)
  // etc
  </code></pre>
  
  <p>Is there a better way?</p>
  
  <p>Also, how about the other part of the equation, meaning the status stored in the <code>DB</code>. Should I only have a <code>status</code> column for the subscription table and store what the app dictates or even bettter create a separate table <code>subscription_statuses</code> and have a <code>foreign_key</code> <code>subscription_status_id</code> in the <code>subscriptions</code> table?</p>