From 3000d6e6d614a9d66aa4a96426af54c847a6bcc4 Mon Sep 17 00:00:00 2001 From: jdw5 Date: Fri, 5 Apr 2024 03:02:34 +1000 Subject: [PATCH] Fixed bug with root level namespacing --- composer.json | 6 ++-- src/Console/Commands/EndpointMakeCommand.php | 3 +- stubs/modal.form.stub | 30 ++++++++++---------- stubs/modal.stub | 22 +++++++++----- stubs/page.form.stub | 17 +++++++---- stubs/page.stub | 2 +- 6 files changed, 47 insertions(+), 33 deletions(-) diff --git a/composer.json b/composer.json index d21bf9e..4f7a2f6 100644 --- a/composer.json +++ b/composer.json @@ -34,9 +34,9 @@ }, "require": { "php": "^8.1.0", - "illuminate/support": "~10.0", - "illuminate/filesystem": "~10.0", - "illuminate/console": "~10.0" + "illuminate/support": ">=10.0.0", + "illuminate/filesystem": ">=10.0.0", + "illuminate/console": ">=10.0.0" }, "require-dev": { diff --git a/src/Console/Commands/EndpointMakeCommand.php b/src/Console/Commands/EndpointMakeCommand.php index b3524e0..705d0ee 100644 --- a/src/Console/Commands/EndpointMakeCommand.php +++ b/src/Console/Commands/EndpointMakeCommand.php @@ -86,7 +86,7 @@ public function handle() $this->replaceInFile( '//', - "return Inertia::render('".$vue."',[\n\t\t\t\n\t\t]);", + "return Inertia::render('".$vue."', [\n\t\t\t\n\t\t]);", $controllerPath ); } @@ -107,6 +107,7 @@ protected function replaceInFile($search, $replace, $path) protected function buildPath(string $path, string $file) { + if ($path === '') return $file; return $path . '/' . $file; } diff --git a/stubs/modal.form.stub b/stubs/modal.form.stub index cc755d7..16d1435 100644 --- a/stubs/modal.form.stub +++ b/stubs/modal.form.stub @@ -1,47 +1,47 @@ \ No newline at end of file diff --git a/stubs/page.form.stub b/stubs/page.form.stub index 6f8a078..e6e0bec 100644 --- a/stubs/page.form.stub +++ b/stubs/page.form.stub @@ -1,16 +1,21 @@