title: How Can I Prevent Showing Duplicate In foreach loop At Laravel Blade File?
body: <p>This is my view blade file:</p>
  
  <p><img src="https://i.imgur.com/lzMFi94.png" alt="1">
  And this is my table data:</p>
  
  <p><img src="https://i.imgur.com/RN04yJg.png" alt="2"></p>
  
  <p>This is my view code :</p>
  
  <pre><code>&lt;form action="" method="post"&gt;
  @csrf
  @foreach($options as $opt)
  
   &lt;label for="siteName"&gt;site name&lt;/label&gt;
   &lt;input type="text" id="siteName" name="siteName" value="{{$opt-&gt;o_name('siteName')}}"&gt;
  
   &lt;label for="siteURL"&gt;site url&lt;/label&gt;
   &lt;input type="text" id="siteURL" name="siteURL" value="{{$opt-&gt;o_name('siteURL')}}"&gt;
  
  @endforeach
  
   &lt;input type="submit" value="save"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This is my controller code:</p>
  
  <pre><code>public function viewOptions()
  {
      $options = Option::all();
      return view('view/options', compact('options'));
  }
  </code></pre>
  
  <p>This is my class code:</p>
  
  <pre><code>protected $guarded = [];
  
  public function o_name($val)
  {
        $valss = DB::table('options')
                     -&gt;select('o_value')
                     -&gt;where('o_name', '=', $val)
                     -&gt;first();
        return $valss-&gt;o_value;
  }
  </code></pre>
  
  <p><strong>I want to show once in view not duplicate Data and inputs form@ 
  How can I do this? what's the problem with my cods?</strong></p>