Initial commit: Struktur aplikasi ilycats

This commit is contained in:
Dwi F Sukmana
2026-02-08 15:16:35 +07:00
commit 0921901aed
235 changed files with 29016 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
<?php
namespace App\Traits;
trait HasPermissions {
public function hasPermission($moduleSlug, $action) {
// Jika user tidak punya role, akses ditolak
if (!$this->role) return false;
// Cek ke tabel permission_role
return $this->role->permissions()
->where('module_slug', $moduleSlug)
->where($action, 1)
->exists();
}
}