TransformsToResource
trait TransformsToResource (View source)
Methods
toResource(string|null $resourceClass = null)
Create a new resource object for the given resource.
guessResource()
Guess the resource class for the model.
static array
guessResourceName()
Guess the resource class name for the model.
string|null
resolveResourceFromAttribute(string $class)
Get the resource class from the class attribute.
Details
JsonResource
toResource(string|null $resourceClass = null)
Create a new resource object for the given resource.
protected JsonResource
guessResource()
Guess the resource class for the model.
static array
guessResourceName()
Guess the resource class name for the model.
protected string|null
resolveResourceFromAttribute(string $class)
Get the resource class from the class attribute.
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.