title: display star rating using laravel
body: <p>I am displaying star rating on html from database. when rating=3 then first 3 star in orange color rest in grey color. I am doing following code. It will give all star in orange color.</p>
  <pre><code> &lt;?php
                          $stars_count=$re-&gt;rating;
                          $count=1;
                          for($i=1;$i&lt;=5;$i++)
                          {
                          if($stars_count &gt;= $count)
                          {
                          ?&gt;
                           &lt;i class=&quot;fa fa-star fa-2x&quot; style=&quot;color:orange&quot;&gt;&lt;/i&gt;
                         &lt;?php 
                           }
                           else
                           {
                          ?&gt;
                           &lt;i class=&quot;fa fa-star fa-2x&quot; style=&quot;color:grey&quot;&gt;&lt;/i&gt;
                          &lt;?php
                           } 
                          }
                          ?&gt;
  </code></pre>