@@ -203,19 +203,6 @@ protected function buildMethods(Controller $controller): string
203203 return trim ($ methods );
204204 }
205205
206- private function determineModel (Controller $ controller , ?string $ reference ): string
207- {
208- if (empty ($ reference ) || $ reference === 'id ' ) {
209- return $ this ->fullyQualifyModelReference ($ controller ->namespace (), Str::studly (Str::singular ($ controller ->prefix ())));
210- }
211-
212- if (Str::contains ($ reference , '. ' )) {
213- return $ this ->fullyQualifyModelReference ($ controller ->namespace (), Str::studly (Str::before ($ reference , '. ' )));
214- }
215-
216- return $ this ->fullyQualifyModelReference ($ controller ->namespace (), Str::studly ($ reference ));
217- }
218-
219206 private function fullyQualifyModelReference (string $ sub_namespace , string $ model_name ): string
220207 {
221208 // TODO: get model_name from tree.
@@ -231,4 +218,17 @@ private function fullyQualifyModelReference(string $sub_namespace, string $model
231218
232219 return config ('blueprint.namespace ' ) . '\\' . ($ sub_namespace ? $ sub_namespace . '\\' : '' ) . $ model_name ;
233220 }
221+
222+ private function determineModel (Controller $ controller , ?string $ reference ): string
223+ {
224+ if (empty ($ reference ) || $ reference === 'id ' ) {
225+ return $ this ->fullyQualifyModelReference ($ controller ->namespace (), Str::studly (Str::singular ($ controller ->prefix ())));
226+ }
227+
228+ if (Str::contains ($ reference , '. ' )) {
229+ return $ this ->fullyQualifyModelReference ($ controller ->namespace (), Str::studly (Str::before ($ reference , '. ' )));
230+ }
231+
232+ return $ this ->fullyQualifyModelReference ($ controller ->namespace (), Str::studly ($ reference ));
233+ }
234234}
0 commit comments