12
12
namespace Lucid \Console \Commands ;
13
13
14
14
use Lucid \Console \Finder ;
15
- use Illuminate \ Filesystem \Filesystem ;
15
+ use Lucid \ Console \Filesystem ;
16
16
use Illuminate \Console \GeneratorCommand ;
17
17
use Illuminate \Config \Repository as Config ;
18
18
use Symfony \Component \Console \Input \InputOption ;
25
25
class ServiceMakeCommand extends GeneratorCommand
26
26
{
27
27
use Finder;
28
+ use Filesystem;
28
29
29
30
/**
30
31
* The base namespace for this command.
@@ -54,13 +55,6 @@ class ServiceMakeCommand extends GeneratorCommand
54
55
*/
55
56
protected $ description = 'Create a new Service ' ;
56
57
57
- /**
58
- * The type of class being generated.
59
- *
60
- * @var string
61
- */
62
- protected $ type = 'Service ' ;
63
-
64
58
/**
65
59
* The directories to be created under the service directory.
66
60
*
@@ -76,6 +70,7 @@ class ServiceMakeCommand extends GeneratorCommand
76
70
'Http/Middleware/ ' ,
77
71
'Http/Requests/ ' ,
78
72
'Providers/ ' ,
73
+ 'Features/ ' ,
79
74
'resources/ ' ,
80
75
'resources/lang/ ' ,
81
76
'resources/views/ ' ,
@@ -105,7 +100,7 @@ public function fire()
105
100
$ path = $ this ->getPath ($ name );
106
101
107
102
if ($ this ->files ->exists ($ path )) {
108
- $ this ->error ($ this -> type . ' already exists! ' );
103
+ $ this ->error (' Service already exists! ' );
109
104
110
105
return false ;
111
106
}
@@ -149,31 +144,6 @@ public function getPath($name)
149
144
return $ this ->findServicePath ($ name );
150
145
}
151
146
152
- /**
153
- * Create an empty directory at the given path.
154
- *
155
- * @param string $path
156
- *
157
- * @return bool
158
- */
159
- public function createDirectory ($ path )
160
- {
161
- return $ this ->files ->makeDirectory ($ path , 0755 , true , true );
162
- }
163
-
164
- /**
165
- * Create a file at the given path with the given contents.
166
- *
167
- * @param string $path
168
- * @param string $contents
169
- *
170
- * @return bool
171
- */
172
- public function createFile ($ path , $ contents = '' )
173
- {
174
- return $ this ->files ->put ($ path , $ contents );
175
- }
176
-
177
147
/**
178
148
* Create the default directories at the given service path.
179
149
*
@@ -236,7 +206,7 @@ public function createRouteServiceProvider($name, $path, $slug, $namespace)
236
206
{
237
207
$ serviceNamespace = $ this ->findServiceNamespace ($ name );
238
208
$ controllers = $ serviceNamespace .'\Http\Controllers ' ;
239
- $ foundation = $ this ->findRootNamespace (). ' \Foundation ' ;
209
+ $ foundation = $ this ->findFoundationNamespace () ;
240
210
241
211
$ content = file_get_contents (__DIR__ .'/stubs/routeserviceprovider.stub ' );
242
212
$ content = str_replace (
0 commit comments