Commit bb4d02ed authored by Nicolas Widart's avatar Nicolas Widart

Optimizing the count querry

parent 0e6d8bb7
......@@ -49,7 +49,7 @@
<label>Role(s)</label>
<select multiple="" class="form-control" name="roles[]">
<?php foreach($roles as $role): ?>
<option value="{{ $role->id }}" <?php echo $user->roles()->whereId($role->id)->get()->count() >= 1 ? 'selected' : '' ?>>{{ $role->name }}</option>
<option value="{{ $role->id }}" <?php echo $user->roles()->whereId($role->id)->count() >= 1 ? 'selected' : '' ?>>{{ $role->name }}</option>
<?php endforeach; ?>
</select>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment