Mercurial > packages > magicforger
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 34:f65ab84ee47f | 35:55d2e5c5dad9 |
|---|---|
| 155 public function routes_name(string $name): string | 155 public function routes_name(string $name): string |
| 156 { | 156 { |
| 157 return Str::singular(Str::studly($name)); | 157 return Str::singular(Str::studly($name)); |
| 158 } | 158 } |
| 159 | 159 |
| 160 /** | |
| 161 * Generate factory name in Studly case. | |
| 162 */ | |
| 163 public function factory_name(string $name): string | |
| 164 { | |
| 165 return Str::singular(Str::studly($name)) . 'Factory'; | |
| 166 } | |
| 167 | |
| 160 // Namespace Methods | 168 // Namespace Methods |
| 161 // These methods handle the formation of various namespaces used within the replacements. | 169 // These methods handle the formation of various namespaces used within the replacements. |
| 162 | 170 |
| 163 /** | 171 /** |
| 164 * Get the root namespace for the application. | 172 * Get the root namespace for the application. |
| 265 public function getShowViewNamespace(string $name): string | 273 public function getShowViewNamespace(string $name): string |
| 266 { | 274 { |
| 267 return $this->getViewNamespace($name) . '\\'; | 275 return $this->getViewNamespace($name) . '\\'; |
| 268 } | 276 } |
| 269 | 277 |
| 278 /** | |
| 279 * Get the factory namespace. | |
| 280 */ | |
| 281 public function getFactoryNamespace(string $name = ''): string | |
| 282 { | |
| 283 return database_path() | |
| 284 . DIRECTORY_SEPARATOR . 'factories' ; | |
| 285 } | |
| 270 | 286 |
| 271 /** | 287 /** |
| 272 * Get the request uses string for replacement. | 288 * Get the request uses string for replacement. |
| 273 */ | 289 */ |
| 274 public function getRequestUses(string $name): string | 290 public function getRequestUses(string $name): string |
