]> _ Git - cubist_cms-back.git/commitdiff
#2783
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 May 2019 14:55:43 +0000 (16:55 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 May 2019 14:55:43 +0000 (16:55 +0200)
src/Cubist/Backpack/app/Console/CubistBackpackCommand.php [new file with mode: 0644]

diff --git a/src/Cubist/Backpack/app/Console/CubistBackpackCommand.php b/src/Cubist/Backpack/app/Console/CubistBackpackCommand.php
new file mode 100644 (file)
index 0000000..bcfa182
--- /dev/null
@@ -0,0 +1,51 @@
+<?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);
+            }
+        }
+
+    }
+
+    protected function _handleMagicFolder(\SplFileInfo $item)
+    {
+        $this->line('Handling ' . $item->getPath());
+    }
+}