Given the following code, all my checkboxes (roles) are marked as checked, even though the user only has one role.
Using Laravel and Spatie Laravel Permissions Package.
I tried the same code in Tinker and it comes back with True, False, False, so it should be working...
@foreach ($roles as $role)
<div>
<label>
<input type="checkbox" value="{{ $role->name }}" checked="{{ $user->hasRole($role->name) ? 'checked' : '' }}">
<span>
{{ $role->name }}
</span>
</label>
</div>
@endforeach