@iamkevinwakhisi please show what you have in your
console.log(role.permissions)
console.log(this.permissions)
from your showEditModal method
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
i am tring to populate data in my edit modal form. i works well with strings but not when i try arrays. My issue here is i have roles and each roles have permissions, i am using spatie/permissions package. https://spatie.be/docs/laravel-permission/v4/basic-usage/basic-usage
showEditModal(role, index) {
let obj = {
id: role.id,
name: role.name,
permissions: role.permissions
};
console.log(role.permissions)
this.editData = obj;
this.editModal = true;
this.index = index;
},
the edit form only shows the role name but not the permissions associated with the role
<Modal v-model="editModal" title="Edit Role" :mask-closable="false">
<Input
v-model="editData.name"
size="large"
maxlength="15"
show-word-limit
placeholder="Create role, Name"
/>
<div class="space"></div>
<Select
prefix="ios-album-outline"
filterable
multiple
v-model="editData.permissions"
clearable
placeholder="Select Roles"
>
<Option :value="p.id" v-for="(p, i) in permissions" :key="i">
{{ p.name }}
</Option>
</Select>
<div slot="footer">
<Button type="default" @click="editModal = false">
Close
</Button>
<Button type="primary" @click="editRole"> Edit Role </Button>
</div>
</Modal>
Please or to participate in this conversation.