File tree Expand file tree Collapse file tree
src/Illuminate/Foundation/Console Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,11 +53,7 @@ public function handle()
5353 */
5454 protected function writeView ()
5555 {
56- $ view = collect (explode ('/ ' , $ this ->argument ('name ' )))
57- ->map (function ($ part ) {
58- return Str::kebab ($ part );
59- })
60- ->implode ('. ' );
56+ $ view = $ this ->getView ();
6157
6258 $ path = resource_path ('views ' ).'/ ' .str_replace ('. ' , '/ ' , 'components. ' .$ view );
6359
@@ -91,11 +87,25 @@ protected function buildClass($name)
9187
9288 return str_replace (
9389 'DummyView ' ,
94- 'view( \'components. ' .Str:: kebab ( class_basename ( $ name ) ).'\') ' ,
90+ 'view( \'components. ' .$ this -> getView ( ).'\') ' ,
9591 parent ::buildClass ($ name )
9692 );
9793 }
9894
95+ /**
96+ * Gets the view path relative to the components dir.
97+ *
98+ * @return string view
99+ */
100+ protected function getView ()
101+ {
102+ return collect (explode ('/ ' , $ this ->argument ('name ' )))
103+ ->map (function ($ part ) {
104+ return Str::kebab ($ part );
105+ })
106+ ->implode ('. ' );
107+ }
108+
99109 /**
100110 * Get the stub file for the generator.
101111 *
You can’t perform that action at this time.
0 commit comments