diff src/Replacer/Replacer.php @ 35:55d2e5c5dad9 ls_dev_2025_09

Working on the factory, it's in a semi working state but obviously not complete
author Luka Sitas <sitas.luka.97@gmail.com>
date Thu, 11 Sep 2025 21:25:51 -0400
parents 010ace248d14
children 116b36f5e73b
line wrap: on
line diff
--- a/src/Replacer/Replacer.php	Wed Sep 10 21:00:47 2025 -0400
+++ b/src/Replacer/Replacer.php	Thu Sep 11 21:25:51 2025 -0400
@@ -157,6 +157,14 @@
         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';
+    }
+
     // Namespace Methods
     // These methods handle the formation of various namespaces used within the replacements.
 
@@ -267,6 +275,14 @@
         return $this->getViewNamespace($name) . '\\';
     }
 
+    /**
+     * Get the factory namespace.
+     */
+    public function getFactoryNamespace(string $name = ''): string
+    {
+        return database_path()
+				. DIRECTORY_SEPARATOR . 'factories' ;
+    }
 
     /**
      * Get the request uses string for replacement.