Fix role assignment check on user creation form

Replaced Auth user roles check with the roles of the user being created. This ensures the correct role is pre-selected based on the user’s roles, rather than the creator's roles.
This commit is contained in:
Daeng Deni Mardaeni
2024-10-31 11:27:34 +07:00
parent 849509b441
commit b185a60b53

View File

@@ -169,7 +169,7 @@
</div>
</div>
<div class="switch switch-sm">
<input {{ in_array($role->name,Auth()->user()->roles->pluck('name')->toArray()) ? 'checked' : '' }} name="roles" type="radio" value="{{ $role->name }}">
<input {{ in_array($role->name,$user->roles->pluck("name")->toArray()) ? 'checked' : '' }} name="roles" type="radio" value="{{ $role->name }}">
</div>
</div>
@endforeach