ResourceCollection<T> class final

A collection of resources; paginators add Laravel's links and meta.

Implemented types

Constructors

ResourceCollection(Object source, JsonResource<T> factory(T item))

Properties

factory → JsonResource<T> Function(T item)
final
hashCode → int
The hash code for this object.
no setterinherited
isPaginated → bool
no setter
items → List<T>
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
source → Object
final

Methods

additional(Map<String, Object?> data) → ResourceCollection<T>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveItems([Request? request]) → List<Map<String, Object?>>
Every item resolved.
toJson() → Object?
override
toPayload([Request? request]) → Object
{data, links, meta} for paginators; {data} (or a bare list when wrapping is disabled) otherwise.
toResponse(Request request) → Response
override
toString() → String
A string representation of this object.
inherited
withStatus(int status) → ResourceCollection<T>

Operators

operator ==(Object other) → bool
The equality operator.
inherited