title: How to loop through an array to get an item?
body: <p>am trying to loop through an array <code>$permission_ids</code> to get the value <code>68</code> and assign it to a <code>$manager_role</code> and store this value in a table <code>permissions</code>, but this block of code can not do that?
  where did i go wrong?</p>
  
  <p>**</p>
  
  <pre><code>foreach ($permission_ids as $permission_id) {
        if($permission_id = 68){
          // attach manager role permission to manager role
          $manager_role-&gt;permissions()-&gt;attach($permission_id);
        }
  
      }
  </code></pre>
  
  <p>**</p>