namespace Cubist\Backpack;
+use Cubist\Backpack\app\Console\Commands\MagicCubistCommand;
use Illuminate\Support\ServiceProvider;
use Route;
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.
*
// // register their aliases
// $loader = \Illuminate\Foundation\AliasLoader::getInstance();
// $loader->alias('Template', \Backpack\Settings\app\Models\Template::class);
+
+ $this->commands([MagicCubistCommand::class]);
}
}
--- /dev/null
+<?php
+
+
+namespace Cubist\Backpack\app\Console\Commands;
+
+use Cubist\Util\Files\Files;
+use Illuminate\Support\Facades\Artisan;
+use Illuminate\Console\Command;
+
+class MagicCubistCommand extends Command
+{
+ /**
+ * The name and signature of the console command.
+ *
+ * @var string
+ */
+ protected $signature = 'cubist:magic:generate';
+
+ /**
+ * The console command description.
+ *
+ * @var string
+ */
+ protected $description = 'Generate Controllers, Requests, Routes, migrations according to magic';
+
+ /**
+ * Execute the console command.
+ *
+ * @return mixed
+ */
+ public function handle()
+ {
+ $name = ucfirst($this->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());
+ }
+}
+++ /dev/null
-<?php
-
-
-namespace Cubist\Backpack\app\Console;
-
-use Cubist\Util\Files\Files;
-use Illuminate\Support\Facades\Artisan;
-use Illuminate\Console\Command;
-
-class CubistBackpackCommand extends Command
-{
- /**
- * The name and signature of the console command.
- *
- * @var string
- */
- protected $signature = 'cubist:magic:generate';
-
- /**
- * The console command description.
- *
- * @var string
- */
- protected $description = 'Generate Controllers, Requests, Routes, migrations according to magic';
-
- /**
- * Execute the console command.
- *
- * @return mixed
- */
- public function handle()
- {
- $name = ucfirst($this->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());
- }
-}