added model check to api show endpoints
This commit is contained in:
@ -48,6 +48,10 @@ class DocumentTransactions extends ApiController
|
||||
{
|
||||
$transaction = Transaction::documentId($document_id)->find($id);
|
||||
|
||||
if (! $transaction instanceof Transaction) {
|
||||
return $this->errorInternal('No query results for model [' . Transaction::class . '] ' . $id);
|
||||
}
|
||||
|
||||
return new Resource($transaction);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user