Group
class Group extends Model (View source)
Traits
Methods to manage a model's icon
attribute.
Methods to manage permissions that are granted to a model.
Methods for models that have validation rules.
Methods to associate uploaded images with a model.
Constants
GUEST_ID |
|
MEMBER_ID |
|
ADMIN_ID |
|
Properties
static protected | $unguarded | from Model | |
string | $icon | from HasIcon | |
?string | $icon_file | The path to the icon file, if the icon is the
|
from HasIcon |
PermissionCollection read-only | $permissions | from ReceivesPermissions | |
$timestamps | |||
int | $id | ||
string | $name | ||
bool | $is_public | ||
null|string | $color | ||
string | $edit_url | ||
Collection read-only | $users |
Methods
Relationship with the permission records granted to this model.
Save the permissions to the database.
Validate an array of data against the model's validation rules.
The model's validation custom attribute translations.
Relationship with the group's users.
Whether this group is the Guest group.
Whether this group is the Member group.
Whether this group is the Admin group.
Whether this group is a custom (user-defined) group.
Get only custom (user-defined) groups.
Get only groups that can be selected for users (admin + custom groups).
No description
No description
Details
in
Model at line 18
getConnectionName()
No description
void
saveIcon(array $icon)
Save the icon using input from an
protected Attribute
iconFile()
No description
static void
bootReceivesPermissions()
No description
MorphMany
permissions()
Relationship with the permission records granted to this model.
void
savePermissions(array|null $grid)
Save the permissions to the database.
static array
validate(array $data, ValidatesData $instance = null)
Validate an array of data against the model's validation rules.
static protected array
rules(ValidatesData $instance = null)
The model's validation rules.
static protected array
messages(ValidatesData $instance = null)
The model's validation messages.
static protected array
customAttributes(ValidatesData $instance = null)
The model's validation custom attribute translations.
BelongsToMany
users()
Relationship with the group's users.
bool
isGuest()
Whether this group is the Guest group.
bool
isMember()
Whether this group is the Member group.
bool
isAdmin()
Whether this group is the Admin group.
bool
isCustom()
Whether this group is a custom (user-defined) group.
static Group
guest()
Get an instance of the Guest group.
static Group
member()
Get an instance of the Member group.
static Group
admin()
Get an instance of the Admin group.
scopeCustom(Builder $query)
Get only custom (user-defined) groups.
scopeSelectable(Builder $query)
Get only groups that can be selected for users (admin + custom groups).
protected Attribute
editUrl()
No description
protected Attribute
usersUrl()
No description