class RelationResolver (View source)

internal  
 

Properties

Collection|Model|null $relationResolver

The relation resolver.

JsonApiResource>|null $relationResourceClass

The relation resource class.

Methods

__construct(string $relationName, Closure|string|null $resolver = null)

Construct a new resource relationship resolver.

handle(mixed $resource)

Resolve the relation for a resource.

string|null
resourceClass()

Get the resource class.

Details

__construct(string $relationName, Closure|string|null $resolver = null)

Construct a new resource relationship resolver.

Parameters

string $relationName
Closure|string|null $resolver

Collection|Model|null handle(mixed $resource)

Resolve the relation for a resource.

Parameters

mixed $resource

Return Value

Collection|Model|null

string|null resourceClass()

Get the resource class.

Return Value

string|null

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.