From 59b107fc663438dd11c9cc7a74dfbdd106971851 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 2 Mar 2017 18:15:06 +0200 Subject: [PATCH] Support creating inline vendors and categories --- app/Models/EntityModel.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Models/EntityModel.php b/app/Models/EntityModel.php index 6bc0c5b290fc..39b7f5fc1459 100644 --- a/app/Models/EntityModel.php +++ b/app/Models/EntityModel.php @@ -95,6 +95,10 @@ class EntityModel extends Eloquent */ public static function getPrivateId($publicId) { + if (! $publicId) { + return null; + } + $className = get_called_class(); return $className::scope($publicId)->withTrashed()->value('id');