ModelHelper
class ModelHelper
| internal |
Methods
Create a new model helper instance.
Get the model's instance, created without running its constructor and memoized per class, so callers must treat it as read-only.
Get the resolver that resolveRelationUsing() registered at boot for the model's relation, without running it.
Create a model instance without running its constructor.
Details
at line 30
__construct(DeclarationDependencyTracker $declarationDependencyTracker, ReflectionProvider $reflectionProvider, RuntimeInputs $runtimeInputs)
Create a new model helper instance.
at line 47
Model
getInstance(ClassReflection $classReflection)
Get the model's instance, created without running its constructor and memoized per class, so callers must treat it as read-only.
What the instance reads, such as its connection, table, key and casts, comes from property defaults and method bodies that are not part of the model's declarations, so their files become dependencies of the files depending on the model.
at line 69
Closure|null
getRelationResolver(ClassReflection $classReflection, string $name)
Get the resolver that resolveRelationUsing() registered at boot for the model's relation, without running it.
at line 81
static Model
newInstanceWithoutConstructor(ClassReflection $classReflection)
Create a model instance without running its constructor.