|
@@ -2,7 +2,7 @@
|
|
|
|
|
|
|
|
namespace Dcat\Admin\Console;
|
|
namespace Dcat\Admin\Console;
|
|
|
|
|
|
|
|
-use Illuminate\Console\GeneratorCommand;
|
|
|
|
|
|
|
+use Illuminate\Support\Str;
|
|
|
|
|
|
|
|
class FormCommand extends GeneratorCommand
|
|
class FormCommand extends GeneratorCommand
|
|
|
{
|
|
{
|
|
@@ -12,7 +12,8 @@ class FormCommand extends GeneratorCommand
|
|
|
* @var string
|
|
* @var string
|
|
|
*/
|
|
*/
|
|
|
protected $signature = 'admin:form {name}
|
|
protected $signature = 'admin:form {name}
|
|
|
- {--namespace=}';
|
|
|
|
|
|
|
+ {--namespace=}
|
|
|
|
|
+ {--base=}';
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* The console command description.
|
|
* The console command description.
|
|
@@ -21,6 +22,20 @@ class FormCommand extends GeneratorCommand
|
|
|
*/
|
|
*/
|
|
|
protected $description = 'Make admin form widget';
|
|
protected $description = 'Make admin form widget';
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @return bool|null
|
|
|
|
|
+ *
|
|
|
|
|
+ * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
|
|
|
|
|
+ */
|
|
|
|
|
+ public function handle()
|
|
|
|
|
+ {
|
|
|
|
|
+ if (! Str::startsWith(config('admin.route.namespace'), 'App')) {
|
|
|
|
|
+ $this->baseDirectory = trim($this->ask('Please enter the destination class path', 'app'));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return parent::handle(); // TODO: Change the autogenerated stub
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Get the stub file for the generator.
|
|
* Get the stub file for the generator.
|
|
|
*
|
|
*
|