class ToMany extends ToMany
Traits
Properties
| protected array<array{rule: string| callable, condition: bool| callable}> | $rules | from HasValidationRules |
|
|
| protected string[] | $validationMessages | from HasValidationRules |
|
|
| protected string[] | $validationAttributes | from HasValidationRules |
|
|
| string|null | $inverse | from FlarumRelationship |
|
|
| bool | $relatedScope | Whether endpoints apply the related resource's scope() when they eager load this relationship. See withoutRelatedScope(). | from FlarumRelationship |
|
Methods
No description
No description
No description
No description
No description
No description
No description
No description
Allow this field to be written to when creating a new model.
Allow this field to be written to when updating a model.
Have endpoints eager load this relationship in full, without the related resource's scope().
Set the inverse relationship name, used for eager loading.
Allow this relationship to be included.
Details
in HasValidationRules
at
line 32
HasValidationRules
rules(array|string $rules, bool|callable $condition, bool $override = true)
in HasValidationRules
at
line 47
HasValidationRules
validationMessages(array $messages)
in HasValidationRules
at
line 54
HasValidationRules
validationAttributes(array $attributes)
in HasValidationRules
at
line 61
HasValidationRules
rule(string|callable $rule, bool|callable $condition = true)
in HasValidationRules
at
line 68
array
getRules()
in HasValidationRules
at
line 73
array
getValidationRules( Context $context)
in HasValidationRules
at
line 88
array
getValidationMessages( Context $context)
in HasValidationRules
at
line 93
array
getValidationAttributes( Context $context)
in HasValidationRules
at
line 98
HasValidationRules
required(bool|callable $condition = true)
in HasValidationRules
at
line 103
HasValidationRules
requiredOnCreate()
in HasValidationRules
at
line 108
HasValidationRules
requiredOnUpdate()
in HasValidationRules
at
line 113
HasValidationRules
requiredWith(array $fields, bool|callable $condition)
in HasValidationRules
at
line 118
HasValidationRules
requiredWithout(array $fields, bool|callable $condition)
in HasValidationRules
at
line 123
HasValidationRules
requiredOnCreateWith(array $fields)
in HasValidationRules
at
line 128
HasValidationRules
requiredOnUpdateWith(array $fields)
in HasValidationRules
at
line 133
HasValidationRules
requiredOnCreateWithout(array $fields)
in HasValidationRules
at
line 138
HasValidationRules
requiredOnUpdateWithout(array $fields)
in HasValidationRules
at
line 143
HasValidationRules
unique(string $table, string $column, bool $ignorable = false, bool|callable $condition = true)
in HasValidationRules
at
line 156
HasValidationRules
in(array $values, bool|callable $condition = true)
in HasValidationRules
at
line 161
HasValidationRules
notIn(array $values, bool|callable $condition = true)
in HasValidationRules
at
line 166
HasValidationRules
items(int $count, bool|callable $condition = true)
in HasValidationRules
at
line 171
protected mixed
evaluate( Context $context, mixed $callback)
in FlarumField
at
line 21
FlarumField
writableOnCreate()
Allow this field to be written to when creating a new model.
in FlarumField
at
line 31
FlarumField
writableOnUpdate()
Allow this field to be written to when updating a model.
in FlarumField
at
line 38
FlarumField
nullable(bool $nullable = true)
in FlarumRelationship
at
line 42
FlarumRelationship
withoutRelatedScope()
Have endpoints eager load this relationship in full, without the related resource's scope().
An endpoint applies the related resource's scope() to the relationships it eager loads, so that only what the actor may see is serialized. But the relation it loads is the model's own, and other code reads it too: a user's `groups`, for one, decide whether they are an admin and what they may do, and the policies that ask have to see every one of them, not only the ones the actor may see. Use this for a relationship that policies or other logic need to read in full. The field must then leave out what the actor may not see in its get() callback. With one, the serializer never loads the relationship itself, so endpoint eager loads are the only place this applies. Constraints given to eagerLoadWhere() still apply, and the rest of a path beyond this relationship is scoped as usual.
in FlarumRelationship
at
line 52
FlarumRelationship
inverse(string $inverse)
Set the inverse relationship name, used for eager loading.
in FlarumRelationship
at
line 62
FlarumRelationship
includable(bool $includable = true)
Allow this relationship to be included.