5
5
use Illuminate \Console \Command ;
6
6
use File ;
7
7
8
- class AngularFeature extends Command{
9
-
8
+ class AngularFeature extends Command
9
+ {
10
10
/**
11
11
* The name and signature of the console command.
12
12
* @var string
@@ -23,21 +23,23 @@ class AngularFeature extends Command{
23
23
* Create a new command instance.
24
24
* @return void
25
25
*/
26
- public function __construct (){
26
+ public function __construct ()
27
+ {
27
28
parent ::__construct ();
28
29
}
29
30
30
31
/**
31
32
* Execute the console command.
32
33
* @return mixed
33
34
*/
34
- public function handle (){
35
+ public function handle ()
36
+ {
35
37
$ name = $ this ->argument ('name ' );
36
38
$ studly_name = studly_case ($ name );
37
39
38
- $ html = file_get_contents (__DIR__ . '/Stubs/AngularFeature/feature.html.stub ' );
39
- $ js = file_get_contents (__DIR__ . '/Stubs/AngularFeature/feature.js.stub ' );
40
- $ less = file_get_contents (__DIR__ . '/Stubs/AngularFeature/feature.less.stub ' );
40
+ $ html = file_get_contents (__DIR__ . '/Stubs/AngularFeature/feature.html.stub ' );
41
+ $ js = file_get_contents (__DIR__ . '/Stubs/AngularFeature/feature.js.stub ' );
42
+ $ less = file_get_contents (__DIR__ . '/Stubs/AngularFeature/feature.less.stub ' );
41
43
42
44
$ html = str_replace ('{{StudlyName}} ' , $ studly_name , $ html );
43
45
$ js = str_replace ('{{StudlyName}} ' , $ studly_name , $ js );
@@ -53,13 +55,13 @@ public function handle(){
53
55
File::makeDirectory ($ folder , 0775 , true );
54
56
55
57
//create view (.html)
56
- File::put ($ folder . '/ ' . $ name . '.html ' , $ html );
58
+ File::put ($ folder. '/ ' . $ name. '.html ' , $ html );
57
59
58
60
//create controller (.js)
59
- File::put ($ folder . '/ ' . $ name . '.js ' , $ js );
61
+ File::put ($ folder. '/ ' . $ name. '.js ' , $ js );
60
62
61
63
//create less file (.less)
62
- \ File::put ($ folder . '/ ' . $ name . '.less ' , $ less );
64
+ File::put ($ folder. '/ ' . $ name. '.less ' , $ less );
63
65
64
66
$ this ->info ('Feature created successfully. ' );
65
67
}
0 commit comments