Свойство | Тип | Описание | |
---|---|---|---|
$type | string | Should be overwritten by subclasses with the value that is to be stored in the database, which will then be used for mapping the hydrated model instance to the proper subtype. |
Свойство | Тип | Описание | |
---|---|---|---|
$dates | |||
$models | array | A map of post types, as specified in the type column, to their classes. | |
$table |
Метод | Описание | |
---|---|---|
boot ( ) | ||
discussion ( ) : |
Define the relationship with the post's discussion. | |
editUser ( ) : |
Define the relationship with the user who edited the post. | |
getModels ( ) : array | Get the type-to-model map. | |
hideUser ( ) : |
Define the relationship with the user who hid the post. | |
isVisibleTo ( User $user ) : boolean | Determine whether or not this post is visible to the given user. | |
newFromBuilder ( array $attributes = [], string | null $connection = null ) : static | object | Create a new model instance according to the post's type. | |
scopeAllTypes ( |
Get all posts, regardless of their type, by removing the RegisteredTypesScope global scope constraints applied on this model. | |
setModel ( string $type, string $model ) : void | Set the model for the given post type. | |
user ( ) : |
Define the relationship with the post's author. |
public discussion ( ) : |
||
Результат |
public editUser ( ) : |
||
Результат |
public hideUser ( ) : |
||
Результат |
public isVisibleTo ( User $user ) : boolean | ||
$user | User | |
Результат | boolean |
public scopeAllTypes ( |
||
$query | ||
Результат |
public user ( ) : |
||
Результат |
protected static array $models | ||
Результат | array |
public static string $type | ||
Результат | string |