title: Livewire Selected Checkbox
body: <p>Im having issues trying to display a list of permissions from the database and then trying to edit the role and its permissions, i cannot get the form to have the permissions assigned to the role to be checked.</p>
  <p>PHP:</p>
  <pre><code>public $role;
  
  public $permissions
  
  public $permissionList;
  
  public function render(PermissionService $permissionService)
  {
      $this-&gt;permissionList = $permissionService-&gt;getPermissions();
      $this-&gt;permissions = $permissionService-&gt;getRolePermissions($this-&gt;role);
  
      return view('livewire.roles.edit');
  }
  </code></pre>
  <p>VIEW:</p>
  <pre><code>@foreach($permissionList as $key =&gt; $permission)
         &lt;div class=&quot;form-row&quot;&gt;
              &lt;div class=&quot;form-group col-md-6 h5&quot;&gt;
                  {{ ucfirst($key) }}
               &lt;/div&gt;
              &lt;div class=&quot;form-group col-md-6&quot;&gt;
              @foreach($permission as $item)
                 &lt;div&gt;
                   &lt;input type=&quot;checkbox&quot; id=&quot;{{ $item['id'] }}&quot; name=&quot;{{ $item['id'] }}&quot; value=&quot;{{ $item['id'] }}&quot; wire:model=&quot;permissions.{{ $item['id'] }}&quot;/&gt; {{ ucfirst($item['name']) }}
                 &lt;/div&gt;
               @endforeach
           &lt;/div&gt;
           &lt;hr/&gt;
      &lt;/div&gt;
     @endforeach
  </code></pre>
  <p>PermissionList Array:</p>
  <pre><code>array:4 [▼
    &quot;administration&quot; =&gt; array:1 [▼
      0 =&gt; array:2 [▼
        &quot;id&quot; =&gt; 15
        &quot;name&quot; =&gt; &quot;preferences&quot;
      ]
    ]
    &quot;users&quot; =&gt; array:5 [▼
      1 =&gt; array:2 [▼
        &quot;id&quot; =&gt; 16
        &quot;name&quot; =&gt; &quot;view&quot;
      ]
      2 =&gt; array:2 [▼
        &quot;id&quot; =&gt; 17
        &quot;name&quot; =&gt; &quot;create&quot;
      ]
      3 =&gt; array:2 [▼
        &quot;id&quot; =&gt; 18
        &quot;name&quot; =&gt; &quot;edit&quot;
      ]
      4 =&gt; array:2 [▼
        &quot;id&quot; =&gt; 19
        &quot;name&quot; =&gt; &quot;delete&quot;
      ]
      5 =&gt; array:2 [▼
        &quot;id&quot; =&gt; 20
        &quot;name&quot; =&gt; &quot;impersonate&quot;
      ]
    ]
  </code></pre>
  <p>I made the permissions list array to have a category and the permissions assigned to that category, purely for display purposes.</p>
  <p>I have tried to make the $permissions the same as the list array and also make it $permission = [‘permissions.15’]; or $permission = [15] etc but i cannot get the permissions assigned to the role be selected.</p>
  <p>Any help would be greatly appreciated.
  Thanks</p>