ModelNotFoundException class final
Thrown by findOrFail() and friends.
- Inheritance
-
- Object
- DaravelException
- HttpException
- ModelNotFoundException
Constructors
-
ModelNotFoundException(String model, [List<
Object?> ids = const <Object?>[]]) -
Laravel's message:
No query results for model [App\Models\User] 1(ids comma separated), or... [App\Models\User].without ids.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
→ Map<
String, String> -
Extra headers to send with the rendered response.
finalinherited
-
ids
→ List<
Object?> -
The ids that were looked up (empty for
firstOrFail()/sole()).final - message → String
-
Human readable description of the failure.
finalinherited
- model → String
-
The model's ModelDefinition.morphClass.
final
- prettyJson → bool
-
Whether the default renderer writes the body pretty-printed, as
Laravel's
Handler::prepareJsonResponsedoes for every HTTP error (JSON_PRETTY_PRINT).AuthenticationExceptionoverrides it: Laravel answers that one with a plainresponse()->json.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → int
-
HTTP status code.
finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited