From: Vincent Vanwaelscappel Date: Wed, 22 May 2019 15:15:09 +0000 (+0200) Subject: #2783 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=eb87b0dfbea3bbe415814a9dd8132ac805e25f60;p=cubist_cms-back.git #2783 --- diff --git a/src/CubistBackpackServiceProvider.php b/src/CubistBackpackServiceProvider.php index c33dc4e..4f24759 100644 --- a/src/CubistBackpackServiceProvider.php +++ b/src/CubistBackpackServiceProvider.php @@ -2,6 +2,7 @@ namespace Cubist\Backpack; +use Cubist\Backpack\app\Console\Commands\MagicCubistCommand; use Illuminate\Support\ServiceProvider; use Route; @@ -26,11 +27,10 @@ class CubistBackpackServiceProvider extends ServiceProvider foreach (glob(__DIR__ . '/routes/cubist/backpack/*.php') as $filename) { $this->loadRoutesFrom($filename); } - $this->loadViewsFrom(__FILE__ . '/resources/views','cubist_back'); + $this->loadViewsFrom(__FILE__ . '/resources/views', 'cubist_back'); } - /** * Register any package services. * @@ -46,5 +46,7 @@ class CubistBackpackServiceProvider extends ServiceProvider // // register their aliases // $loader = \Illuminate\Foundation\AliasLoader::getInstance(); // $loader->alias('Template', \Backpack\Settings\app\Models\Template::class); + + $this->commands([MagicCubistCommand::class]); } } diff --git a/src/app/Console/Commands/MagicCubistCommand.php b/src/app/Console/Commands/MagicCubistCommand.php new file mode 100644 index 0000000..712277c --- /dev/null +++ b/src/app/Console/Commands/MagicCubistCommand.php @@ -0,0 +1,51 @@ +argument('name')); + + // Find cubistmagic directories + $iterator = Files::getDirectoryIterator(app_path(), true); + $magics = []; + foreach ($iterator as $item) { + /** @var $item \SplFileInfo */ + if ($item->isDir() && $item->getFilename() == 'cubistmagic') { + $this->_handleMagicFolder($item); + } + } + $this->executeProcess('composer dump-autoload'); + } + + protected function _handleMagicFolder(\SplFileInfo $item) + { + $this->line('Handling ' . $item->getPath()); + } +} diff --git a/src/app/Console/CubistBackpackCommand.php b/src/app/Console/CubistBackpackCommand.php deleted file mode 100644 index 804e827..0000000 --- a/src/app/Console/CubistBackpackCommand.php +++ /dev/null @@ -1,51 +0,0 @@ -argument('name')); - - // Find cubistmagic directories - $iterator = Files::getDirectoryIterator(app_path(), true); - $magics = []; - foreach ($iterator as $item) { - /** @var $item \SplFileInfo */ - if ($item->isDir() && $item->getFilename() == 'cubistmagic') { - $this->_handleMagicFolder($item); - } - } - $this->executeProcess('composer dump-autoload'); - } - - protected function _handleMagicFolder(\SplFileInfo $item) - { - $this->line('Handling ' . $item->getPath()); - } -}