diff --git a/src/Console/UiCommand.php b/src/Console/UiCommand.php index 825c12fdd..94d929924 100644 --- a/src/Console/UiCommand.php +++ b/src/Console/UiCommand.php @@ -64,15 +64,15 @@ public function handle() $this->updateNodeScripts(function ($scripts) { return [ 'canvas.ui.dev' => 'mix', - 'canvas.ui.prod' => 'mix --production' + 'canvas.ui.prod' => 'mix --production', ] + $scripts; }); // Sass configuration... - copy(dirname(__DIR__, 2) . '/resources/sass/ui.scss', resource_path('sass/canvas-ui.scss')); + copy(dirname(__DIR__, 2).'/resources/sass/ui.scss', resource_path('sass/canvas-ui.scss')); // Single page application... - (new Filesystem)->copyDirectory(dirname(__DIR__, 2) . '/resources/js/ui', resource_path('js/canvas-ui')); + (new Filesystem)->copyDirectory(dirname(__DIR__, 2).'/resources/js/ui', resource_path('js/canvas-ui')); $this->updateWebpackConfiguration(); $this->flushNodeModules(); @@ -90,7 +90,7 @@ public function handle() */ protected function updateNodePackages(callable $callback, $dev = true) { - if (!file_exists(base_path('package.json'))) { + if (! file_exists(base_path('package.json'))) { return; } @@ -107,7 +107,7 @@ protected function updateNodePackages(callable $callback, $dev = true) file_put_contents( base_path('package.json'), - json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) . PHP_EOL + json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL ); } @@ -120,7 +120,7 @@ protected function updateNodePackages(callable $callback, $dev = true) */ protected function updateNodeScripts(callable $callback) { - if (!file_exists(base_path('package.json'))) { + if (! file_exists(base_path('package.json'))) { return; } @@ -137,7 +137,7 @@ protected function updateNodeScripts(callable $callback) file_put_contents( base_path('package.json'), - json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) . PHP_EOL + json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL ); } @@ -148,13 +148,13 @@ protected function updateNodeScripts(callable $callback) */ protected function exportViews() { - if (file_exists($view = $this->getViewPath('canvas-ui.blade.php')) && !$this->option('force')) { - if (!$this->confirm('The [canvas-ui.blade.php] view already exists. Do you want to replace it?')) { + if (file_exists($view = $this->getViewPath('canvas-ui.blade.php')) && ! $this->option('force')) { + if (! $this->confirm('The [canvas-ui.blade.php] view already exists. Do you want to replace it?')) { return; } } - copy(dirname(__DIR__, 2) . '/resources/views/ui.blade.php', $view); + copy(dirname(__DIR__, 2).'/resources/views/ui.blade.php', $view); } /** @@ -169,13 +169,13 @@ protected function exportBackend() str_replace( '{{namespace}}', $this->laravel->getNamespace(), - file_get_contents(dirname(__DIR__, 2) . '/resources/stubs/controllers/CanvasUiController.stub') + file_get_contents(dirname(__DIR__, 2).'/resources/stubs/controllers/CanvasUiController.stub') ) ); file_put_contents( base_path('routes/web.php'), - file_get_contents(dirname(__DIR__, 2) . '/resources/stubs/routes/web.stub'), + file_get_contents(dirname(__DIR__, 2).'/resources/stubs/routes/web.stub'), FILE_APPEND ); } @@ -217,7 +217,7 @@ protected function updateWebpackConfiguration() { file_put_contents( base_path('webpack.mix.js'), - file_get_contents(dirname(__DIR__, 2) . '/resources/stubs/webpack.mix.stub'), + file_get_contents(dirname(__DIR__, 2).'/resources/stubs/webpack.mix.stub'), FILE_APPEND ); }