OMNI Access v1.3.0 Free ~13 min read

OMNI Access API Reference

Full API reference for user trait methods, Role, Permission and Group models, OmniAccessManager, and the CacheService.

A Administrator Oct 17, 2026 5 Steps 2,604 views
Discussion (0)
Step 1 of 5

User Model Methods (via Traits)

Method Description Returns
assignRole(...$roles) Assign one or more roles to user self
removeRole(...$roles) Remove roles from user self
syncRoles(...$roles) Replace all user roles self
hasRole($role) Check if user has role bool
hasAnyRole(...$roles) Check if user has any of the roles bool
hasAllRoles(...$roles) Check if user has all roles bool
hasPermission($permission) Check if user has permission bool
hasAnyPermission(...$permissions) Check if user has any permission bool
hasAllPermissions(...$permissions) Check if user has all permissions bool
givePermissionTo(...$permissions) Give direct permissions to user self
revokePermissionTo(...$permissions) Revoke direct permissions self
getAllPermissions() Get all user permissions Collection
getCachedRoles() Get cached user roles Collection
getGroupedPermissions() Get permissions grouped by category Collection
isSuperAdmin() Check if user is super admin bool
refreshPermissionsCache() Refresh user's permission cache void
Step 2 of 5

Role Model Methods

Method Description Returns
givePermissionTo(...$permissions) Give permissions to role self
revokePermissionTo(...$permissions) Remove permissions from role self
syncPermissions(...$permissions) Sync role permissions self
hasPermission($permission) Check if role has permission bool
getCachedPermissions() Get cached role permissions Collection
getAllCached() Get all roles from cache Collection
findBySlugCached($slug) Find role by slug (cached) ?Role
getDefaultRole() Get default role ?Role
permissions() Get permissions relationship BelongsToMany
users() Get users relationship BelongsToMany
Step 3 of 5

Permission Model Methods

Method Description Returns
group() Get permission group BelongsTo
roles() Get roles with this permission BelongsToMany
getAllCached() Get all permissions cached Collection
findBySlugCached($slug) Find permission by slug ?Permission
Step 4 of 5

OmniAccessManager Methods

Method Description Returns
createRole($attributes) Create new role Role
createPermission($attributes) Create new permission Permission
createGroup($attributes) Create permission group Group
findRole($identifier) Find role by ID/slug/name ?Role
findPermission($identifier) Find permission by ID/slug ?Permission
findGroup($identifier) Find group by ID/slug ?Group
getAllRoles() Get all roles Collection
getAllPermissions() Get all permissions Collection
getAllGroups() Get all groups with permissions Collection
clearCache() Clear all RBAC cache void
Step 5 of 5

CacheService Methods

Method Description Returns
remember($key, $callback, $ttl) Cache with callback mixed
forget($key) Remove from cache void
flush() Clear all RBAC cache void
forgetUser($userId) Clear user cache void
forgetRole($roleId) Clear role cache void
forgetPermission($permissionId) Clear permission cache void

Note: All methods are fully documented with PHPDoc comments in the source code for better IDE support.

Previous Step

Congratulations! You Completed This Guide

You've walked through all 5 steps for OMNI Access v1.3.0. Keep practicing and exploring more hands-on tutorials.

Community Discussions 0

Ask questions, share step solutions, or discuss software workflows with other professionals.

Moderated Community

Join the Community Discussion

Got stuck on a step or have a question about this configuration? Sign in to join the discussion and receive direct advice from instructors and peers.

No Discussions Yet

Have a question or found a clever tip for this guide? Start the conversation using the comment box above!

Promotional Ads Available Space
Place Your advertising ads Here

Promote your brand, product, or service directly to our active readers and community.

Contact Us