diff src/Generator/Controller/ControllerGenerator.php @ 7:769a17898cc0

Various changes to the generators and replacers - probably mostly just formatting
author luka
date Wed, 18 Oct 2023 21:04:11 -0400
parents b0b2e79ad8e6
children d4730c14806d
line wrap: on
line diff
--- a/src/Generator/Controller/ControllerGenerator.php	Thu Oct 12 19:44:22 2023 -0400
+++ b/src/Generator/Controller/ControllerGenerator.php	Wed Oct 18 21:04:11 2023 -0400
@@ -4,7 +4,6 @@
 
 use Symfony\Component\Console\Attribute\AsCommand;
 use Wizzard\MagicForger\Generator\BaseGenerator;
-use Illuminate\Support\Str;
 
 #[AsCommand(name: 'mf:controller')]
 class ControllerGenerator extends BaseGenerator
@@ -35,7 +34,7 @@
      */
     public function handle()
     {
-        $table = $this->getTable($this->getTableInput());
+        $this->setCurrentTable($this->getTableInput());
         parent::handle();
     }
 
@@ -52,7 +51,8 @@
     /**
      * Resolve the fully-qualified path to the stub.
      *
-     * @param  string  $stub
+     * @param string $stub
+     *
      * @return string
      */
     protected function resolveStubPath($stub)
@@ -74,6 +74,6 @@
      */
     protected function getPath($name = null)
     {
-        return str_replace(['App\\', '\\'], ['app/', '/'], $this->getControllerNamespace() . '/' . $this->controller_name($this->getTableInput()) . '.php');
+        return str_replace(['App\\', '\\'], ['app/', '/'], $this->getControllerNamespace().'/'.$this->controller_name($this->getTableInput()).'.php');
     }
 }