@@ -104,6 +104,8 @@ private function buildMethods(Controller $controller)
104
104
}
105
105
106
106
$ body = '' ;
107
+ $ using_validation = false ;
108
+
107
109
foreach ($ statements as $ statement ) {
108
110
if ($ statement instanceof SendStatement) {
109
111
$ body .= self ::INDENT .$ statement ->output ().PHP_EOL ;
@@ -115,6 +117,7 @@ private function buildMethods(Controller $controller)
115
117
$ this ->addImport ($ controller , config ('blueprint.namespace ' ).'\\Mail \\' .$ statement ->mail ());
116
118
}
117
119
} elseif ($ statement instanceof ValidateStatement) {
120
+ $ using_validation = true ;
118
121
$ class_name = $ controller ->name ().Str::studly ($ name ).'Request ' ;
119
122
120
123
$ fqcn = config ('blueprint.namespace ' ).'\\Http \\Requests \\' .($ controller ->namespace () ? $ controller ->namespace ().'\\' : '' ).$ class_name ;
@@ -153,7 +156,7 @@ private function buildMethods(Controller $controller)
153
156
} elseif ($ statement instanceof SessionStatement) {
154
157
$ body .= self ::INDENT .$ statement ->output ().PHP_EOL ;
155
158
} elseif ($ statement instanceof EloquentStatement) {
156
- $ body .= self ::INDENT .$ statement ->output ($ controller ->prefix (), $ name ).PHP_EOL ;
159
+ $ body .= self ::INDENT .$ statement ->output ($ controller ->prefix (), $ name, $ using_validation ).PHP_EOL ;
157
160
$ this ->addImport ($ controller , $ this ->determineModel ($ controller , $ statement ->reference ()));
158
161
} elseif ($ statement instanceof QueryStatement) {
159
162
$ body .= self ::INDENT .$ statement ->output ($ controller ->prefix ()).PHP_EOL ;
0 commit comments