getOrFail
Get an entity using a primary key, if the id is not found this method throws an EntityNotFound
Exception
No casting is necessary on the Id value type as we do this automatically for you.
Returns
This function returns any
Arguments
Key
Type
Required
Default
Description
entityName
string
Yes
---
id
any
Yes
---
Examples
Last updated