Group
class Group extends Model implements TwillModelContract (View source)
Traits
Properties
$translatedAttributes | from IsTranslatable | ||
$timestamps | |||
protected | $fillable | ||
$checkboxes | |||
protected | $casts |
Methods
This method should be clean of checks, the checks should happen earlier on.
Add global permission to item, after making sure the permission is valid
Revoke global permission from the item, after making sure the permission is valid
Add module permission to item, after making sure the permission is valid
Revoke module permission from the item, after making sure the permission is valid
Revoke all module permissions from the item
Add module item permission, after making sure the permission is valid
Revoke module item permissions, after making sure the permission is valid
Revoke all module item permissions
Revoke all permissions from a list of permission ids
Check if a permission is available for a particular scope
Checks if this model is translatable.
Return the Everyone group.
Return the group title.
No description
No description
No description
No description
Check if current group is the Everyone group.
Return the formatted created date.
Check if the group can be edited (not a system group, ie. Everyone).
Check if the group can be published (not a system group, ie. Everyone).
Return the formatted number of users in this group.
Return viewable items.
Return ids of permissionable items.
Return permissionable items.
No description
No description
Details
BelongsToMany
permissions()
This method should be clean of checks, the checks should happen earlier on.
void
grantGlobalPermission(string $name)
Add global permission to item, after making sure the permission is valid
void
revokeGlobalPermission(string $name)
Revoke global permission from the item, after making sure the permission is valid
void
grantModulePermission(string $name, string|object $permissionableType)
Add module permission to item, after making sure the permission is valid
void
revokeModulePermission(string $name, string|object $permissionableType)
Revoke module permission from the item, after making sure the permission is valid
void
revokeAllModulePermission(string|object $permissionableType)
Revoke all module permissions from the item
void
grantModuleItemPermission(string $name, object $permissionableItem)
Add module item permission, after making sure the permission is valid
void
revokeModuleItemPermission(string $name, object $permissionableItem)
Revoke module item permissions, after making sure the permission is valid
void
revokeModuleItemAllPermissions(object $permissionableItem)
Revoke all module item permissions
void
revokeAllPermissions()
Revoke all permissions
void
removePermissions(int[] $permissionableIds)
Revoke all permissions from a list of permission ids
protected void
checkPermissionAvailable(string $name, string $scope)
Check if a permission is available for a particular scope
bool
isTranslatable(null|array|string $columns = null)
Checks if this model is translatable.
If no columns/column is provided it will return true if the model itself is translatable.
static Group
getEveryoneGroup()
Return the Everyone group.
string
getTitleInBrowserAttribute()
Return the group title.
Builder
scopePublished(Builder $query)
No description
Builder
scopeDraft(Builder $query)
No description
Builder
scopeOnlyTrashed(Builder $query)
No description
BelongsToMany
users()
No description
bool
isEveryoneGroup()
Check if current group is the Everyone group.
string
getCreatedAtAttribute($value)
Return the formatted created date.
bool
getCanEditAttribute()
Check if the group can be edited (not a system group, ie. Everyone).
bool
getCanPublishAttribute()
Check if the group can be published (not a system group, ie. Everyone).
string
getUsersCountAttribute()
Return the formatted number of users in this group.
Collection
viewableItems()
Return viewable items.
array
permissionableIds()
Return ids of permissionable items.
Collection
permissionableItems()
Return permissionable items.
Builder
scopeAccessible(Builder $query)
No description
array
getTranslatedAttributes()
No description