@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$factory->define(App\Modules\OauthClients\OauthClient::class, function (Faker\Generator $faker) { |
|
| 3 | +$factory->define(App\Modules\OauthClients\OauthClient::class, function(Faker\Generator $faker) { |
|
| 4 | 4 | return [ |
| 5 | 5 | 'user_id' => $faker->randomDigit(), |
| 6 | 6 | 'name' => $faker->name(), |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | | |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -Route::group(['prefix' => 'notifications'], function () { |
|
| 14 | +Route::group(['prefix' => 'notifications'], function() { |
|
| 15 | 15 | |
| 16 | 16 | Route::get('/', 'NotificationController@index'); |
| 17 | 17 | Route::get('unread', 'NotificationController@unread'); |
@@ -17,9 +17,9 @@ |
||
| 17 | 17 | public function __call($name, $arguments) |
| 18 | 18 | { |
| 19 | 19 | foreach (\Module::all() as $module) { |
| 20 | - $nameSpace = 'App\\Modules\\' . $module['basename'] ; |
|
| 20 | + $nameSpace = 'App\\Modules\\'.$module['basename']; |
|
| 21 | 21 | $model = ucfirst(\Str::singular($name)); |
| 22 | - $class = $nameSpace . '\\Repositories\\' . $model . 'Repository'; |
|
| 22 | + $class = $nameSpace.'\\Repositories\\'.$model.'Repository'; |
|
| 23 | 23 | |
| 24 | 24 | if (class_exists($class)) { |
| 25 | 25 | return \App::make($class); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | | |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -Route::group(['prefix' => 'settings'], function () { |
|
| 14 | +Route::group(['prefix' => 'settings'], function() { |
|
| 15 | 15 | |
| 16 | 16 | Route::get('/', 'SettingController@index'); |
| 17 | 17 | Route::get('/{id}', 'SettingController@find'); |
@@ -28,27 +28,27 @@ |
||
| 28 | 28 | public function register() |
| 29 | 29 | { |
| 30 | 30 | //Bind Core Facade to the Service Container |
| 31 | - $this->app->singleton('Core', function () { |
|
| 31 | + $this->app->singleton('Core', function() { |
|
| 32 | 32 | return new \App\Modules\Core\Core; |
| 33 | 33 | }); |
| 34 | 34 | |
| 35 | 35 | //Bind ErrorHandler Facade to the Service Container |
| 36 | - $this->app->singleton('ErrorHandler', function () { |
|
| 36 | + $this->app->singleton('ErrorHandler', function() { |
|
| 37 | 37 | return new \App\Modules\Core\Utl\ErrorHandler; |
| 38 | 38 | }); |
| 39 | 39 | |
| 40 | 40 | //Bind CoreConfig Facade to the Service Container |
| 41 | - $this->app->singleton('CoreConfig', function () { |
|
| 41 | + $this->app->singleton('CoreConfig', function() { |
|
| 42 | 42 | return new \App\Modules\Core\Utl\CoreConfig; |
| 43 | 43 | }); |
| 44 | 44 | |
| 45 | 45 | //Bind Media Facade to the Service Container |
| 46 | - $this->app->singleton('Media', function () { |
|
| 46 | + $this->app->singleton('Media', function() { |
|
| 47 | 47 | return new \App\Modules\Core\Utl\Media; |
| 48 | 48 | }); |
| 49 | 49 | |
| 50 | 50 | //Bind ApiConsumer Facade to the Service Container |
| 51 | - $this->app->singleton('ApiConsumer', function () { |
|
| 51 | + $this->app->singleton('ApiConsumer', function() { |
|
| 52 | 52 | $app = app(); |
| 53 | 53 | return new \App\Modules\Core\Utl\ApiConsumer($app, $app['request'], $app['router']); |
| 54 | 54 | }); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | | |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -Route::group(['prefix' => 'reports'], function () { |
|
| 14 | +Route::group(['prefix' => 'reports'], function() { |
|
| 15 | 15 | |
| 16 | 16 | Route::get('/', 'ReportController@index'); |
| 17 | 17 | Route::get('/{id}', 'ReportController@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 | |
@@ -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 | } |
@@ -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'), |