5
5
use Illuminate \Config \Repository ;
6
6
use Illuminate \Console \Command ;
7
7
use Illuminate \Filesystem \Filesystem as File ;
8
+ use Illuminate \Support \Str ;
8
9
9
10
class ThemeGeneratorCommand extends Command
10
11
{
@@ -89,10 +90,11 @@ public function handle()
89
90
$ this ->themePath = $ this ->config ->get ('theme.theme_path ' );
90
91
$ this ->theme ['name ' ] = strtolower ($ this ->argument ('name ' ));
91
92
92
- if (empty ($ this ->theme ['name ' ])) {
93
+ if (empty ($ this ->theme ['name ' ])) {
93
94
$ this ->theme ['name ' ] = $ this ->ask ('What is your theme name? ' );
94
- if (empty ($ this ->theme ['name ' ])) {
95
- $ this ->error ("Theme is not Generated, Theme name required !!! " );
95
+ if (empty ($ this ->theme ['name ' ])) {
96
+ $ this ->error ('Theme is not Generated, Theme name required !!! ' );
97
+
96
98
return ;
97
99
}
98
100
}
@@ -101,7 +103,7 @@ public function handle()
101
103
}
102
104
103
105
/**
104
- * Theme Initialize
106
+ * Theme Initialize.
105
107
*
106
108
* @return void
107
109
*/
@@ -143,10 +145,10 @@ public function consoleAsk()
143
145
$ this ->theme ['title ' ] = $ this ->ask ('What is theme title? ' );
144
146
145
147
$ this ->theme ['description ' ] = $ this ->ask ('What is theme description? ' , false );
146
- $ this ->theme ['description ' ] = !$ this ->theme ['description ' ] ? '' : title_case ($ this ->theme ['description ' ]);
148
+ $ this ->theme ['description ' ] = !$ this ->theme ['description ' ] ? '' : Str:: title ($ this ->theme ['description ' ]);
147
149
148
150
$ this ->theme ['author ' ] = $ this ->ask ('What is theme author name? ' , false );
149
- $ this ->theme ['author ' ] = !$ this ->theme ['author ' ] ? '' : title_case ($ this ->theme ['author ' ]);
151
+ $ this ->theme ['author ' ] = !$ this ->theme ['author ' ] ? '' : Str:: title ($ this ->theme ['author ' ]);
150
152
151
153
$ this ->theme ['version ' ] = $ this ->ask ('What is theme version? ' , false );
152
154
$ this ->theme ['version ' ] = !$ this ->theme ['version ' ] ? '1.0.0 ' : $ this ->theme ['version ' ];
@@ -174,8 +176,10 @@ public function createStubs($themeStubFiles, $createdThemePath)
174
176
} elseif ($ filename == 'theme ' ) {
175
177
$ filename = pathinfo ($ storePath , PATHINFO_EXTENSION );
176
178
} elseif ($ filename == 'css ' || $ filename == 'js ' ) {
177
- $ this ->theme [$ filename ] = ltrim ($ storePath ,
178
- rtrim ($ this ->config ->get ('theme.folders.assets ' ), '/ ' ).'/ ' );
179
+ $ this ->theme [$ filename ] = ltrim (
180
+ $ storePath ,
181
+ rtrim ($ this ->config ->get ('theme.folders.assets ' ), '/ ' ).'/ '
182
+ );
179
183
}
180
184
$ themeStubFile = $ this ->themeStubPath .'/ ' .$ filename .'.stub ' ;
181
185
$ this ->makeFile ($ themeStubFile , $ createdThemePath .'/ ' .$ storePath );
0 commit comments