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 file type.

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

getConnectionName()

No description

from  Model
void
saveIcon(array $icon)

Save the icon using input from an component.

from  HasIcon
Attribute
iconFile()

No description

from  HasIcon
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 array
rules(ValidatesData $instance = null)

The model's validation rules.

static array
messages(ValidatesData $instance = null)

The model's validation messages.

static 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).

Attribute
editUrl()

No description

Attribute
usersUrl()

No description

Details

getConnectionName()

No description

void saveIcon(array $icon)

Save the icon using input from an component.

Parameters

array $icon

Return Value

void

protected Attribute iconFile()

No description

Return Value

Attribute

static void bootReceivesPermissions()

No description

Return Value

void

MorphMany permissions()

Relationship with the permission records granted to this model.

Return Value

MorphMany

void savePermissions(array|null $grid)

Save the permissions to the database.

Parameters

array|null $grid

Return Value

void

static array validate(array $data, ValidatesData $instance = null)

Validate an array of data against the model's validation rules.

Parameters

array $data
ValidatesData $instance

Return Value

array

static protected array rules(ValidatesData $instance = null)

The model's validation rules.

Parameters

ValidatesData $instance

Return Value

array

static protected array messages(ValidatesData $instance = null)

The model's validation messages.

Parameters

ValidatesData $instance

Return Value

array

static protected array customAttributes(ValidatesData $instance = null)

The model's validation custom attribute translations.

Parameters

ValidatesData $instance

Return Value

array

BelongsToMany users()

Relationship with the group's users.

Return Value

BelongsToMany

bool isGuest()

Whether this group is the Guest group.

Return Value

bool

bool isMember()

Whether this group is the Member group.

Return Value

bool

bool isAdmin()

Whether this group is the Admin group.

Return Value

bool

bool isCustom()

Whether this group is a custom (user-defined) group.

Return Value

bool

static Group guest()

Get an instance of the Guest group.

Return Value

Group

static Group member()

Get an instance of the Member group.

Return Value

Group

static Group admin()

Get an instance of the Admin group.

Return Value

Group

scopeCustom(Builder $query)

Get only custom (user-defined) groups.

Parameters

Builder $query

scopeSelectable(Builder $query)

Get only groups that can be selected for users (admin + custom groups).

Parameters

Builder $query

protected Attribute editUrl()

No description

Return Value

Attribute

protected Attribute usersUrl()

No description

Return Value

Attribute