fix(:datatable): menyesuaikan kolom aksi yang ditampilkan berdasarkan permission yang dimiliki

This commit is contained in:
Yoga Pangestu 2025-11-14 09:16:03 +07:00
parent 878644c30d
commit 9a3b4a57e2
14 changed files with 27 additions and 14 deletions

View File

@ -128,7 +128,8 @@ class='flex items-center space-x-2 bg-gray-50 border border-gray-200 rounded-lg
return $actions;
})
->html(),
->html()
->hideIf(auth()->user()->cannot('update bottle') && auth()->user()->cannot('delete bottle')),
];
}

View File

@ -93,7 +93,8 @@ public function columns(): array
return $actions;
})
->html(),
->html()
->hideIf(auth()->user()->cannot('update brand') && auth()->user()->cannot('delete brand')),
];
}

View File

@ -84,7 +84,8 @@ public function columns(): array
return $actions;
})
->html(),
->html()
->hideIf(auth()->user()->cannot('update category') && auth()->user()->cannot('delete category')),
];
}

View File

@ -132,7 +132,7 @@ class='flex items-center space-x-2 bg-gray-50 border border-gray-200 rounded-lg
return $actions;
})
->html()
->hideIf(auth()->user()->cannot('update perfume', 'delete perfume')),
->hideIf(auth()->user()->cannot('update perfume') && auth()->user()->cannot('delete perfume')),
];
}

View File

@ -120,7 +120,8 @@ class='flex items-center space-x-2 bg-gray-50 border border-gray-200 rounded-lg
return $actions;
})
->html(),
->html()
->hideIf(auth()->user()->cannot('update product') && auth()->user()->cannot('delete product')),
];
}

View File

@ -86,7 +86,8 @@ public function columns(): array
return $actions;
})
->html(),
->html()
->hideIf(auth()->user()->cannot('update choose us') && auth()->user()->cannot('delete choose us')),
];
}

View File

@ -86,7 +86,8 @@ public function columns(): array
return $actions;
})
->html(),
->html()
->hideIf(auth()->user()->cannot('update perfume feature') && auth()->user()->cannot('delete perfume feature')),
];
}

View File

@ -54,7 +54,8 @@ public function columns(): array
return $actions;
})
->html(),
->html()
->hideIf(auth()->user()->cannot('update expense') && auth()->user()->cannot('delete expense')),
];
}

View File

@ -90,7 +90,8 @@ public function columns(): array
return $actions;
})
->html(),
->html()
->hideIf(auth()->user()->cannot('update customer') && auth()->user()->cannot('delete customer')),
];
}

View File

@ -124,7 +124,8 @@ public function columns(): array
return $actions;
})
->html(),
->html()
->hideIf(auth()->user()->cannot('update voucher') && auth()->user()->cannot('delete voucher')),
];
}

View File

@ -55,7 +55,8 @@ public function columns(): array
return $actions;
})
->html(),
->html()
->hideIf(auth()->user()->cannot('update artcile') && auth()->user()->cannot('delete artcile')),
];
}

View File

@ -84,7 +84,8 @@ public function columns(): array
return $actions;
})
->html(),
->html()
->hideIf(auth()->user()->cannot('update faq') && auth()->user()->cannot('delete faq')),
];
}

View File

@ -130,7 +130,8 @@ public function columns(): array
return $actions;
})
->html(),
->html()
->hideIf(auth()->user()->cannot('show order') && auth()->user()->cannot('delete order')),
];
}

View File

@ -71,7 +71,8 @@ public function columns(): array
return $actions;
})
->html(),
->html()
->hideIf(auth()->user()->cannot('update purchase')),
];
}