create-prisma-php-app 1.8.12 → 1.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/app/api/api.php +17 -2
- package/package.json +1 -1
package/dist/src/app/api/api.php
CHANGED
|
@@ -60,8 +60,8 @@ if (stripos($contentType, 'application/json') !== false) {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// Construct the full class name and check for class and property existence
|
|
63
|
-
$fullClassName = "Lib\\Prisma\\Classes\\" . $className;
|
|
64
|
-
if (!class_exists($fullClassName) || !property_exists(Prisma::class, $className)) {
|
|
63
|
+
$fullClassName = "Lib\\Prisma\\Classes\\" . pascalCase($className);
|
|
64
|
+
if (!class_exists($fullClassName) || !property_exists(Prisma::class, camelCase($className))) {
|
|
65
65
|
echo json_encode(['error' => "Error: Class $fullClassName not found or property $className not found in Prisma class!"]);
|
|
66
66
|
exit;
|
|
67
67
|
}
|
|
@@ -81,3 +81,18 @@ try {
|
|
|
81
81
|
} catch (\ArgumentCountError | \Exception $e) {
|
|
82
82
|
echo json_encode(['error' => "Error: " . $e->getMessage()]);
|
|
83
83
|
}
|
|
84
|
+
|
|
85
|
+
function camelCase($string)
|
|
86
|
+
{
|
|
87
|
+
$string = ucwords($string, "_");
|
|
88
|
+
$string = str_replace("_", "", $string);
|
|
89
|
+
$string = lcfirst($string);
|
|
90
|
+
return $string;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function pascalCase($string)
|
|
94
|
+
{
|
|
95
|
+
$string = ucwords($string, "_");
|
|
96
|
+
$string = str_replace("_", "", $string);
|
|
97
|
+
return $string;
|
|
98
|
+
}
|