@@ -59,8 +59,9 @@ public function handle(): void
59
59
60
60
$ livewireMakeCommand = new LivewireMakeCommand ();
61
61
62
- if ($ livewireMakeCommand ->isReservedClassName ($ name = $ this ->parser ->className ())) {
62
+ if ($ livewireMakeCommand ->isReservedClassName ($ name = $ this ->parser ->className ())) {
63
63
$ this ->line ("<fg=red;options=bold>Class is reserved:</> {$ name }" );
64
+
64
65
return ;
65
66
}
66
67
@@ -102,7 +103,7 @@ protected function createClass(bool $force = false)
102
103
*/
103
104
protected function createView (bool $ force = false )
104
105
{
105
- if (! $ this ->option ('view ' )) {
106
+ if (! $ this ->option ('view ' )) {
106
107
return null ;
107
108
}
108
109
@@ -136,7 +137,7 @@ protected function ensureDirectoryExists($path): void
136
137
*/
137
138
public function classContents (): string
138
139
{
139
- if ($ this ->model ) {
140
+ if ($ this ->model ) {
140
141
$ template = file_get_contents (__DIR__ .DIRECTORY_SEPARATOR .'table-with-model.stub ' );
141
142
142
143
$ contents = str_replace (
@@ -147,21 +148,24 @@ public function classContents(): string
147
148
} else {
148
149
$ template = file_get_contents (__DIR__ .DIRECTORY_SEPARATOR .'table.stub ' );
149
150
150
- $ contents = str_replace (
151
+ $ contents = str_replace (
151
152
['[namespace] ' , '[class] ' ],
152
153
[$ this ->parser ->classNamespace (), $ this ->parser ->className ()],
153
154
$ template
154
155
);
155
156
}
156
157
157
- if ($ this ->viewPath ) {
158
- $ contents = Str::replaceLast ("} \n" , "
158
+ if ($ this ->viewPath ) {
159
+ $ contents = Str::replaceLast (
160
+ "} \n" ,
161
+ "
159
162
public function rowView(): string
160
163
{
161
164
return ' " . $ this ->getViewPathForRowView () . "';
162
165
}
163
166
} \n" ,
164
- $ contents );
167
+ $ contents
168
+ );
165
169
}
166
170
167
171
return $ contents ;
@@ -188,11 +192,11 @@ public function viewContents()
188
192
*/
189
193
public function getModelImport (): string
190
194
{
191
- if (File::exists (app_path ('Models/ ' . $ this ->model . '.php ' ))) {
195
+ if (File::exists (app_path ('Models/ ' . $ this ->model . '.php ' ))) {
192
196
return 'App\Models \\' . $ this ->model ;
193
197
}
194
198
195
- if (File::exists (app_path ($ this ->model . '.php ' ))) {
199
+ if (File::exists (app_path ($ this ->model . '.php ' ))) {
196
200
return 'App \\' . $ this ->model ;
197
201
}
198
202
0 commit comments