title: Get value from select field and compare against database
body: <p><strong>What I'm needing:</strong></p>
  
  <p>Using the following DB column <code>clay_plan_type</code></p>
  
  <pre><code>+----+------------------+
  | id | clay_plan_type   |
  +----+------------------+
  |  5 | Single Shooter   |
  |  6 | Lunch Sponsor    |
  |  7 | Beverage Sponsor |
  +----+------------------+
  </code></pre>
  
  <p>I want to disable the select options in my form if the value of my select field matches the value in <code>clay_plan_type</code></p>
  
  <p><strong>View example:</strong></p>
  
  <pre><code>@if ($sponsortype === "Beverage Sponsor")
  &lt;option value="" disabled&gt;Beverage Sponsor: SOLD OUT&lt;/option&gt;
  @else
  &lt;option value="Beverage Sponsor"&gt;Beverage Sponsor: $250&lt;/option&gt;
  @endif
  etc...
  </code></pre>
  
  <p><strong>Controller Example:</strong></p>
  
  <pre><code>$sponsortype = DB::table('clay_shoots')-&gt;select('clay_plan_type')-&gt;get();
  return view('clayshoot.sponsorform',compact('sponsortype'));
  </code></pre>
  
  <p>When I <code>dd($sponsortype);</code> I get the following:</p>
  
  <pre><code>Collection {#855 ▼
    #items: array:3 [▼
      0 =&gt; {#801 ▼
        +"clay_plan_type": "Single Shooter"
      }
      1 =&gt; {#802 ▼
        +"clay_plan_type": "Lunch Sponsor"
      }
      2 =&gt; {#803 ▼
        +"clay_plan_type": "Beverage Sponsor"
      }
    ]
  }
  </code></pre>
  
  <p>I get no errors when running the <code>if statement</code> in the view, but I don't get the correct results. It acts as the `if statement is not there.</p>
  
  <p>So I try adding <code>$sponsortype-&gt;clay_plan_type</code> and I get the error:</p>
  
  <blockquote>
    <p>Property [clay_plan_type] does not exist on this collection instance.</p>
  </blockquote>
  
  <p>If I run in a <code>foreach loop</code> this works in the View but I get multiple repeats of the same item in the select field. (See below image)</p>
  
  <pre><code>@foreach($sponsortype as $st)
    @if ($st-&gt;clay_plan_type == "Beverage Sponsor" )
      YUP
    @else
      NOPE
    @endif
  @endforeach
  // OUTPUT: NOPE NOPE YUP ("Beverage Sponsor" is the last record in the table)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/mPZTR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mPZTR.jpg" alt="enter image description here"></a>
  Hope I'm explaining this in a way you understand. If you need more info, please let me know. Any help in figuring this out would be appreciated. </p>