class Page extends Model (View source)

Traits

Methods to give a model a formatted text body.

Methods to manage a model's icon attribute.

Methods to manage permissions on a model.

Methods for models that can be a part of the forum "structure", like channels, pages, links, and headings.

Methods to associate uploaded images with a model.

Properties

static protected $unguarded from  Model
static protected Formatter[] $formatters from  UsesFormatter
string $body

The original unformatted version of the body.

from  HasBody
string $parsed_body

The intermediary parsed XML document.

from  HasBody
HtmlString read-only $body_html

The formatted HTML version of the body for the current user.

from  HasBody
string read-only $body_text

The parsed body with formatting removed.

from  HasBody
Collection read-only $mentions from  HasBody
Collection read-only $attachments from  HasBody
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  HasPermissions
Structure read-only $structure from  Structurable
$timestamps
int $id
string $name
string $slug
string $url
string $edit_url

Methods

getConnectionName()

No description

from  Model
HtmlString|string
format(string $attribute, User $user = null)

Render an attribute as HTML for the given user.

static Formatter
getFormatter(string $attribute)

Set a formatter instance for this model.

static void
setFormatter(string $attribute, Formatter $formatter)

Set a formatter instance for this model.

getAttribute($key)

No description

setAttribute($key, $value)

No description

static void
bootHasBody()

No description

from  HasBody
MorphToMany
mentions()

Relationship with the users who were mentioned in the body.

from  HasBody
MorphToMany
attachments()

Relationship with the uploads that were attached in the body.

from  HasBody
void
saveIcon(array $icon)

Save the icon using input from an component.

from  HasIcon
Attribute
iconFile()

No description

from  HasIcon
static void
bootHasPermissions()

No description

MorphMany
permissions()

Relationship with the permission records pertaining to this model.

array
abilities()

A list of abilities that can be applied to this model.

array
defaultAbilities()

A list of abilities to check by default when creating a model.

void
savePermissions(array|null $grid)

Save the permissions to the database.

bool
isPublic(string $ability = 'view')

No description

static array|null
allPermitted(User|null $user, string $ability = 'view')

Get the model IDs that the given user has permission for.

static void
bootStructurable()

No description

MorphOne
structure()

Relationship with the node for this model within the forum structure.

static void
booting()

No description

Attribute
url()

No description

Attribute
editUrl()

No description

Details

getConnectionName()

No description

HtmlString|string format(string $attribute, User $user = null)

Render an attribute as HTML for the given user.

Parameters

string $attribute
User $user

Return Value

HtmlString|string

static Formatter getFormatter(string $attribute)

Set a formatter instance for this model.

Parameters

string $attribute

Return Value

Formatter

static void setFormatter(string $attribute, Formatter $formatter)

Set a formatter instance for this model.

Parameters

string $attribute
Formatter $formatter

Return Value

void

getAttribute($key)

No description

Parameters

$key

setAttribute($key, $value)

No description

Parameters

$key
$value

static void bootHasBody()

No description

Return Value

void

MorphToMany mentions()

Relationship with the users who were mentioned in the body.

Return Value

MorphToMany

MorphToMany attachments()

Relationship with the uploads that were attached in the body.

Return Value

MorphToMany

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 bootHasPermissions()

No description

Return Value

void

MorphMany permissions()

Relationship with the permission records pertaining to this model.

Return Value

MorphMany

array abilities()

A list of abilities that can be applied to this model.

Return Value

array

array defaultAbilities()

A list of abilities to check by default when creating a model.

Return Value

array

void savePermissions(array|null $grid)

Save the permissions to the database.

Parameters

array|null $grid

Return Value

void

bool isPublic(string $ability = 'view')

No description

Parameters

string $ability

Return Value

bool

static array|null allPermitted(User|null $user, string $ability = 'view')

Get the model IDs that the given user has permission for.

If the user is an admin, the result will be null, meaning there is no restriction on the models they have permission for.

Parameters

User|null $user
string $ability

Return Value

array|null

static void bootStructurable()

No description

Return Value

void

MorphOne structure()

Relationship with the node for this model within the forum structure.

Return Value

MorphOne

static protected void booting()

No description

Return Value

void

protected Attribute url()

No description

Return Value

Attribute

protected Attribute editUrl()

No description

Return Value

Attribute