55use Illuminate \Config \Repository ;
66use Illuminate \Console \Command ;
77use Illuminate \Filesystem \Filesystem as File ;
8+ use Illuminate \Support \Str ;
89
910class ThemeGeneratorCommand extends Command
1011{
@@ -89,10 +90,11 @@ public function handle()
8990 $ this ->themePath = $ this ->config ->get ('theme.theme_path ' );
9091 $ this ->theme ['name ' ] = strtolower ($ this ->argument ('name ' ));
9192
92- if (empty ($ this ->theme ['name ' ])) {
93+ if (empty ($ this ->theme ['name ' ])) {
9394 $ 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+
9698 return ;
9799 }
98100 }
@@ -101,7 +103,7 @@ public function handle()
101103 }
102104
103105 /**
104- * Theme Initialize
106+ * Theme Initialize.
105107 *
106108 * @return void
107109 */
@@ -143,10 +145,10 @@ public function consoleAsk()
143145 $ this ->theme ['title ' ] = $ this ->ask ('What is theme title? ' );
144146
145147 $ 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 ' ]);
147149
148150 $ 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 ' ]);
150152
151153 $ this ->theme ['version ' ] = $ this ->ask ('What is theme version? ' , false );
152154 $ this ->theme ['version ' ] = !$ this ->theme ['version ' ] ? '1.0.0 ' : $ this ->theme ['version ' ];
@@ -174,8 +176,10 @@ public function createStubs($themeStubFiles, $createdThemePath)
174176 } elseif ($ filename == 'theme ' ) {
175177 $ filename = pathinfo ($ storePath , PATHINFO_EXTENSION );
176178 } 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+ );
179183 }
180184 $ themeStubFile = $ this ->themeStubPath .'/ ' .$ filename .'.stub ' ;
181185 $ this ->makeFile ($ themeStubFile , $ createdThemePath .'/ ' .$ storePath );
0 commit comments