added model check to api show endpoints
This commit is contained in:
@ -42,6 +42,11 @@ class Contacts extends ApiController
|
||||
$contact = Contact::where('email', $id)->first();
|
||||
}
|
||||
|
||||
if (! $contact instanceof Contact) {
|
||||
//return $this->noContent();
|
||||
return $this->errorInternal('No query results for model [' . Contact::class . '] ' . $id);
|
||||
}
|
||||
|
||||
return new Resource($contact);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user