diff src/Replacer/Replacer.php @ 45:c7fd31303024 default tip

merging down to default
author Luka Sitas <sitas.luka.97@gmail.com>
date Thu, 12 Nov 2026 21:19:53 -0500
parents 116b36f5e73b
children
line wrap: on
line diff
--- a/src/Replacer/Replacer.php	Wed Sep 10 21:00:47 2025 -0400
+++ b/src/Replacer/Replacer.php	Thu Nov 12 21:19:53 2026 -0500
@@ -157,6 +157,22 @@
         return Str::singular(Str::studly($name));
     }
 
+    /**
+     * Generate factory name in Studly case.
+     */
+    public function factory_name(string $name): string
+    {
+        return Str::singular(Str::studly($name)) . 'Factory';
+    }
+
+    /**
+     * Generate test name in Studly case.
+     */
+    public function test_name(string $name): string
+    {
+        return Str::singular(Str::studly($name)) . 'Test';
+    }
+
     // Namespace Methods
     // These methods handle the formation of various namespaces used within the replacements.
 
@@ -267,6 +283,24 @@
         return $this->getViewNamespace($name) . '\\';
     }
 
+    /**
+     * Get the factory namespace.
+     */
+    public function getFactoryNamespace(string $name = ''): string
+    {
+        return database_path()
+				. DIRECTORY_SEPARATOR . 'factories' ;
+    }
+
+    /**
+     * Get the test namespace.
+     */
+    public function getTestNamespace(string $name = ''): string
+    {
+        return base_path()
+				. DIRECTORY_SEPARATOR . 'tests' 
+				. DIRECTORY_SEPARATOR . 'CRUD' ;
+    }
 
     /**
      * Get the request uses string for replacement.