diff src/Replacer/Replacer.php @ 27:b17f81b804ff codex

Added support for routes
author Luka Sitas <sitas.luka.97@gmail.com>
date Mon, 02 Jun 2025 21:51:09 -0400
parents 1a717c7b211f
children 010ace248d14
line wrap: on
line diff
--- a/src/Replacer/Replacer.php	Thu May 15 21:50:38 2025 -0400
+++ b/src/Replacer/Replacer.php	Mon Jun 02 21:51:09 2025 -0400
@@ -138,6 +138,16 @@
     {
         return '';
     }
+
+
+    /**
+     * Generate route name in Studly case.
+     */
+    public function routes_name(string $name): string
+    {
+        return Str::singular(Str::studly($name));
+    }
+
     // Namespace Methods
     // These methods handle the formation of various namespaces used within the replacements.
 
@@ -152,6 +162,17 @@
     /**
      * Get the model namespace.
      */
+    public function getRouteNamespace(string $name = ''): string
+    {
+			return base_path()
+				. DIRECTORY_SEPARATOR . 'routes' 
+				. DIRECTORY_SEPARATOR . 'resources'
+				;
+    }
+
+    /**
+     * Get the model namespace.
+     */
     public function getModelNamespace(string $name = ''): string
     {
         return $this->getRootNamespace().'Models';