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.