public static function getPrivateId($publicId) { $className = get_called_class(); return $className::scope($publicId)->withTrashed()->value('id'); }