Skip to content

Commit

Permalink
Fixed bug with root level namespacing
Browse files Browse the repository at this point in the history
  • Loading branch information
jdw5 committed Apr 4, 2024
1 parent d3747ac commit 3000d6e
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 33 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
3 changes: 2 additions & 1 deletion src/Console/Commands/EndpointMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
Expand All @@ -107,6 +107,7 @@ protected function replaceInFile($search, $replace, $path)

protected function buildPath(string $path, string $file)
{
if ($path === '') return $file;
return $path . '/' . $file;
}

Expand Down
30 changes: 15 additions & 15 deletions stubs/modal.form.stub
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
<template>
<Head title="" />
<Modal>
<ModalBody>
<ModalHeader>
<!-- Title -->
</ModalHeader>
<form @submit.prevent="submit" class="p-4 space-y-4">

<!-- ... -->

<div class="flex gap-x-4 justify-end items-center">
<SecondaryButton type="button" @click="close">
<form @submit.prevent="onSubmit">
<ModalContent>
<!-- ... -->
</ModalContent>
<ModalFooter>
<SecondaryButton @click="close">
Cancel
</SecondaryButton>
<PrimaryButton type="submit">
Create
</PrimaryButton>
</div>
</ModalFooter>
</form>
</ModalBody>
</Modal>
</template>

<script setup>
import { useForm } from '@inertiajs/vue3'
import { Head, useForm } from '@inertiajs/vue3'
import { ref } from 'vue'
import { useModal } from 'momentum-modal'
import Modal from '@/Components/Modal/Modal.vue';
import ModalHeader from '@/Components/Modal/ModalHeader.vue';
import ModalBody from '@/Components/Modal/ModalBody.vue';
import SecondaryButton from '@/Components/Buttons/SecondaryButton.vue';
import PrimaryButton from '@/Components/Buttons/PrimaryButton.vue';
import { Modal, ModalBody ModalHeader, ModalContent, ModalFooter } from '@/Components/Modal';
import { PrimaryButton, SecondaryButton } from '@/Components/Button
import { Text } from '@/Components/Utility'
import { Field } from '@/Components/Form

const { close } = useModal()

const props = defineProps({

// name: Type,
})

const form = useForm({
// ...
})

const submit = () => {
const onSubmit = () => {
form.submit(route(''), {
onSuccess: () => {
close()
Expand Down
22 changes: 15 additions & 7 deletions stubs/modal.stub
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
<template>
<Head title="" />
<Modal>
<ModalBody>
<ModalHeader>
<!-- Title -->
</ModalHeader>

<!-- ... -->

<ModalContent>
<!-- ... -->
</ModalContent>
<ModalFooter>
<SecondaryButton @click="close">
Close
</SecondaryButton>
</ModalFooter>
</ModalBody>
</Modal>
</template>

<script setup>
import { Head } from '@inertiajs/vue3'
import { ref } from 'vue'
import { useModal } from 'momentum-modal'
import Modal from '@/Components/Modal/Modal.vue';
import ModalHeader from '@/Components/Modal/ModalHeader.vue';
import ModalBody from '@/Components/Modal/ModalBody.vue';
import { Modal, ModalBody ModalHeader, ModalContent, ModalFooter } from '@/Components/Modal';
import { PrimaryButton, SecondaryButton } from '@/Components/Button
import { Text } from '@/Components/Utility'

const { close } = useModal()

const props = defineProps({

// name: Type
})

</script>
17 changes: 11 additions & 6 deletions stubs/page.form.stub
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
<template>
<Head title="New Page"></Head>

<!-- ... -->

<Form @submit.prevent="onSubmit">
<!-- ... -->
<div>
<PrimaryButton type="submit">
Create
</PrimaryButton>
</div>
</Form>
</template>

<script setup>
import { Head, useForm } from '@inertiajs/vue3';
import { ref } from 'vue';
import MainLayout from '@/Layouts/MainLayout.vue';
import SecondaryButton from '@/Components/Buttons/SecondaryButton.vue';
import PrimaryButton from '@/Components/Buttons/PrimaryButton.vue';
import { PrimaryButton, SecondaryButton } from '@/Components/Button
import { Form, Field } from '@/Components/Form'

defineOptions({ layout: MainLayout })

Expand All @@ -22,7 +27,7 @@ const form = useForm({
// ...
})

const submit = () => {
const onSubmit = () => {
form.submit(route(''), {
onSuccess: () => {
close()
Expand Down
2 changes: 1 addition & 1 deletion stubs/page.stub
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<Head title="New Page"></Head>
<Head title="New Page" />

<!-- ... -->

Expand Down

0 comments on commit 3000d6e

Please sign in to comment.