From 27b5ed6015923faa0a6084a24fe692fbb18af570 Mon Sep 17 00:00:00 2001 From: KJ Date: Sun, 12 May 2024 04:38:45 -0400 Subject: [PATCH] Convert model name from PascalCase to snake_case (table name). --- src/Libs/Model.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Libs/Model.php b/src/Libs/Model.php index 76565e4..257cf89 100644 --- a/src/Libs/Model.php +++ b/src/Libs/Model.php @@ -287,7 +287,14 @@ class Model { */ public static function className(): string { - return strtolower(substr(strrchr(get_called_class(), '\\'), 1)); + return strtolower( + preg_replace( + '/(?