Resolvable
trait Resolvable
Methods
No description
No description
Retrieves the first instance
Retrieves the first instance or fails
Retrieves the latest instance
Retrieves all instances
No description
Resolves an instance
Resolves an instance or throws an exception
Resolves multiple instances by their primary fields
Finds an instance by its primary field
Finds an instance by its primary field or throws an exception
Finds multiple instances by their primary fields
Details
at line 20
protected
getPrimaryField()
at line 26
protected
getResolvableField()
at line 39
static protected mixed
resolvableContext(Closure $context)
Exectures the context if object can be resolved
at line 55
static Resolvable|null
first()
Retrieves the first instance
at line 71
static Resolvable
firstOrFail()
Retrieves the first instance or fails
at line 90
static Resolvable|null
last()
Retrieves the latest instance
at line 105
static Collection|LazyCollection
all()
Retrieves all instances
at line 121
static
chunked($chunkSize = null)
at line 147
static Resolvable|Collection|null
resolve(mixed $resolveBy, string|null $field = null)
Resolves an instance
at line 168
static Resolvable|Collection
resolveOrFail(mixed $resolveBy)
Resolves an instance or throws an exception
at line 185
static Collection
resolveMany(array $resolveBy)
Resolves multiple instances by their primary fields
at line 198
static Resolvable|Collection|null
find(mixed|array|Collection $findBy)
Finds an instance by its primary field
at line 225
static Resolvable|Collection
findOrFail(mixed|array $findBy)
Finds an instance by its primary field or throws an exception
at line 245
static Collection
findMany(array $findBy)
Finds multiple instances by their primary fields