comparison 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
comparison
equal deleted inserted replaced
26:555bfaa500ac 27:b17f81b804ff
136 */ 136 */
137 public function show_view_name(string $name): string 137 public function show_view_name(string $name): string
138 { 138 {
139 return ''; 139 return '';
140 } 140 }
141
142
143 /**
144 * Generate route name in Studly case.
145 */
146 public function routes_name(string $name): string
147 {
148 return Str::singular(Str::studly($name));
149 }
150
141 // Namespace Methods 151 // Namespace Methods
142 // These methods handle the formation of various namespaces used within the replacements. 152 // These methods handle the formation of various namespaces used within the replacements.
143 153
144 /** 154 /**
145 * Get the root namespace for the application. 155 * Get the root namespace for the application.
146 */ 156 */
147 public function getRootNamespace(): string 157 public function getRootNamespace(): string
148 { 158 {
149 return $this->laravel->getNamespace(); 159 return $this->laravel->getNamespace();
160 }
161
162 /**
163 * Get the model namespace.
164 */
165 public function getRouteNamespace(string $name = ''): string
166 {
167 return base_path()
168 . DIRECTORY_SEPARATOR . 'routes'
169 . DIRECTORY_SEPARATOR . 'resources'
170 ;
150 } 171 }
151 172
152 /** 173 /**
153 * Get the model namespace. 174 * Get the model namespace.
154 */ 175 */