class ApiSerializer implements ExtenderInterface
Methods
attributes(callable|string $callback)
Add to or modify the attributes array of this serializer.
hasOne(string $name, string $serializerClass)
Establish a simple hasOne relationship from this serializer to another serializer.
hasMany(string $name, string $serializerClass)
Establish a simple hasMany relationship from this serializer to another serializer.
relationship(string $name, $callback)
Add a relationship from this serializer to another serializer.
Details
at
line 28
__construct(string $serializerClass)
at
line 47
ApiSerializer
attribute(string $name, $callback)
at
line 70
ApiSerializer
attributes(callable|string $callback)
Add to or modify the attributes array of this serializer.
at
line 87
ApiSerializer
hasOne(string $name, string $serializerClass)
Establish a simple hasOne relationship from this serializer to another serializer.
This represents a one-to-one relationship.
at
line 104
ApiSerializer
hasMany(string $name, string $serializerClass)
Establish a simple hasMany relationship from this serializer to another serializer.
This represents a one-to-many relationship.
at
line 127
ApiSerializer
relationship(string $name, $callback)
Add a relationship from this serializer to another serializer.