@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function toArray($request) |
19 | 19 | { |
20 | - if (! $this->resource) { |
|
20 | + if ( ! $this->resource) { |
|
21 | 21 | return []; |
22 | 22 | } |
23 | 23 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function toArray($request) |
19 | 19 | { |
20 | - if (! $this->resource) { |
|
20 | + if ( ! $this->resource) { |
|
21 | 21 | return []; |
22 | 22 | } |
23 | 23 |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $this->container['slug'] = Str::slug($this->argument('slug')); |
89 | 89 | $this->container['name'] = Str::studly($this->container['slug']); |
90 | 90 | $this->container['version'] = '1.0'; |
91 | - $this->container['description'] = 'This is the description for the ' . $this->container['name'] . ' module.'; |
|
91 | + $this->container['description'] = 'This is the description for the '.$this->container['name'].' module.'; |
|
92 | 92 | $this->container['location'] = config('modules.default_location'); |
93 | 93 | $this->container['provider'] = config("modules.locations.{$this->container['location']}.provider"); |
94 | 94 | $this->container['basename'] = Str::studly($this->container['slug']); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | |
122 | 122 | $progress->finish(); |
123 | 123 | |
124 | - event($this->container['slug'] . '.module.made'); |
|
124 | + event($this->container['slug'].'.module.made'); |
|
125 | 125 | |
126 | 126 | $this->info("\nModule generated successfully."); |
127 | 127 | } |
@@ -136,18 +136,18 @@ discard block |
||
136 | 136 | $manifest = config("modules.locations.$location.manifest") ?: 'module.json'; |
137 | 137 | $provider = config("modules.locations.$location.provider") ?: 'ModuleServiceProvider'; |
138 | 138 | |
139 | - if (!$this->files->isDirectory($root)) { |
|
139 | + if ( ! $this->files->isDirectory($root)) { |
|
140 | 140 | $this->files->makeDirectory($root); |
141 | 141 | } |
142 | 142 | |
143 | 143 | $directory = module_path(null, $this->container['basename'], $location); |
144 | - $source = __DIR__ . '/Stubs/Module'; |
|
144 | + $source = __DIR__.'/Stubs/Module'; |
|
145 | 145 | |
146 | 146 | $this->files->makeDirectory($directory); |
147 | 147 | |
148 | 148 | $sourceFiles = $this->files->allFiles($source, true); |
149 | 149 | |
150 | - if (!empty($this->mapping)) { |
|
150 | + if ( ! empty($this->mapping)) { |
|
151 | 151 | $search = array_keys($this->mapping); |
152 | 152 | $replace = array_values($this->mapping); |
153 | 153 | } |
@@ -156,11 +156,11 @@ discard block |
||
156 | 156 | $contents = $this->replacePlaceholders($file->getContents()); |
157 | 157 | $subPath = $file->getRelativePathname(); |
158 | 158 | |
159 | - if (!empty($this->mapping)) { |
|
159 | + if ( ! empty($this->mapping)) { |
|
160 | 160 | $subPath = str_replace($search, $replace, $subPath); |
161 | 161 | } |
162 | 162 | |
163 | - $filePath = $directory . '/' . $subPath; |
|
163 | + $filePath = $directory.'/'.$subPath; |
|
164 | 164 | |
165 | 165 | // if the file is module.json, replace it with the custom manifest file name |
166 | 166 | if ($file->getFilename() === 'module.json' && $manifest) { |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | |
176 | 176 | $dir = dirname($filePath); |
177 | 177 | |
178 | - if (! $this->files->isDirectory($dir)) { |
|
178 | + if ( ! $this->files->isDirectory($dir)) { |
|
179 | 179 | $this->files->makeDirectory($dir, 0755, true); |
180 | 180 | } |
181 | 181 | |
@@ -207,19 +207,19 @@ discard block |
||
207 | 207 | ]; |
208 | 208 | |
209 | 209 | $replace = [ |
210 | - ucfirst($modelNameSingular) . 'Factory', |
|
210 | + ucfirst($modelNameSingular).'Factory', |
|
211 | 211 | $modelNameSingular, |
212 | 212 | $this->container['slug'], |
213 | 213 | ucfirst($modelName), |
214 | 214 | ucfirst($modelNameSingular), |
215 | - ucfirst($modelName) . 'DatabaseSeeder', |
|
216 | - ucfirst($modelName) . 'TableSeeder', |
|
217 | - ucfirst($modelNameSingular) . 'Controller', |
|
218 | - ucfirst($modelNameSingular) . 'Repository', |
|
219 | - 'Insert' . ucfirst($modelNameSingular), |
|
220 | - 'Update' . ucfirst($modelNameSingular), |
|
215 | + ucfirst($modelName).'DatabaseSeeder', |
|
216 | + ucfirst($modelName).'TableSeeder', |
|
217 | + ucfirst($modelNameSingular).'Controller', |
|
218 | + ucfirst($modelNameSingular).'Repository', |
|
219 | + 'Insert'.ucfirst($modelNameSingular), |
|
220 | + 'Update'.ucfirst($modelNameSingular), |
|
221 | 221 | ucfirst($modelNameSingular), |
222 | - ucfirst($modelNameSingular) . 'Observer', |
|
222 | + ucfirst($modelNameSingular).'Observer', |
|
223 | 223 | $modelName, |
224 | 224 | $modelName, |
225 | 225 | ]; |
@@ -241,6 +241,6 @@ discard block |
||
241 | 241 | protected function generateMigration() |
242 | 242 | { |
243 | 243 | $modelName = $this->container['slug']; |
244 | - return $this->callSilent('make:module:migration', ['slug' => $modelName, 'name' => 'create_' . $modelName . '_table']); |
|
244 | + return $this->callSilent('make:module:migration', ['slug' => $modelName, 'name' => 'create_'.$modelName.'_table']); |
|
245 | 245 | } |
246 | 246 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | /** |
19 | 19 | * Assign the permissions to the admin group. |
20 | 20 | */ |
21 | - \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['DummyModelName'])->each(function ($permission) use ($adminGroupId) { |
|
21 | + \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['DummyModelName'])->each(function($permission) use ($adminGroupId) { |
|
22 | 22 | \DB::table('groups_permissions')->insert( |
23 | 23 | [ |
24 | 24 | 'permission_id' => $permission->id, |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$factory->define(App\Modules\DummyModule\DummyModel::class, function (Faker\Generator $faker) { |
|
3 | +$factory->define(App\Modules\DummyModule\DummyModel::class, function(Faker\Generator $faker) { |
|
4 | 4 | return [ |
5 | 5 | // Add factory attributes |
6 | 6 | 'created_at' => $faker->dateTimeBetween('-1 years', 'now'), |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | Route::group([ |
55 | 55 | 'middleware' => 'web', |
56 | 56 | 'namespace' => $this->namespace, |
57 | - ], function ($router) { |
|
57 | + ], function($router) { |
|
58 | 58 | require module_path('DummyModuleSlug', 'Routes/web.php', 'app'); |
59 | 59 | }); |
60 | 60 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | 'middleware' => 'api', |
73 | 73 | 'namespace' => $this->namespace, |
74 | 74 | 'prefix' => 'api', |
75 | - ], function ($router) { |
|
75 | + ], function($router) { |
|
76 | 76 | require module_path('DummyModuleSlug', 'Routes/api.php', 'app'); |
77 | 77 | }); |
78 | 78 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function toArray($request) |
19 | 19 | { |
20 | - if (! $this->resource) { |
|
20 | + if ( ! $this->resource) { |
|
21 | 21 | return []; |
22 | 22 | } |
23 | 23 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | | |
14 | 14 | */ |
15 | 15 | |
16 | -Route::group(['prefix' => 'DummyRoutePrefix'], function () { |
|
16 | +Route::group(['prefix' => 'DummyRoutePrefix'], function() { |
|
17 | 17 | |
18 | 18 | Route::get('/', 'DummyController@index'); |
19 | 19 | Route::get('/{id}', 'DummyController@find'); |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function toArray($request) |
19 | 19 | { |
20 | - if (! $this->resource) { |
|
20 | + if ( ! $this->resource) { |
|
21 | 21 | return []; |
22 | 22 | } |
23 | 23 |