+
+
- {{title}}
+ {{ title }}
diff --git a/resources/js/Layouts/AuthenticatedLayout.vue b/resources/js/Layouts/AuthenticatedLayout.vue
index b218aaa..0454634 100644
--- a/resources/js/Layouts/AuthenticatedLayout.vue
+++ b/resources/js/Layouts/AuthenticatedLayout.vue
@@ -8,6 +8,12 @@ import ResponsiveNavLink from '@/Components/ResponsiveNavLink.vue';
import { Link } from '@inertiajs/vue3';
const showingNavigationDropdown = ref(false);
+const links = [
+ { href: route('dashboard'), active: route().current('dashboard'), text: 'Dashboard' },
+ { href: route('items.index'), active: route().current('items.index'), text: 'Items' },
+ { href: route('attribute_types.index'), active: route().current('attribute_types.index'), text: 'Attribute Types' },
+ { href: route('attributes.index'), active: route().current('attributes.index'), text: 'Attributes' },
+];
@@ -28,18 +34,12 @@ const showingNavigationDropdown = ref(false);
-
-
- Dashboard
+
+
+ {{ link.text }}
-
-
-
- Items
-
-
@@ -118,9 +118,9 @@ const showingNavigationDropdown = ref(false);
:class="{ block: showingNavigationDropdown, hidden: !showingNavigationDropdown }"
class="sm:hidden"
>
-
-
- Dashboard
+
+
+ {{ link.text }}
diff --git a/resources/js/Pages/AttributeTypes/Edit.vue b/resources/js/Pages/AttributeTypes/Edit.vue
new file mode 100644
index 0000000..43e8568
--- /dev/null
+++ b/resources/js/Pages/AttributeTypes/Edit.vue
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
diff --git a/resources/js/Pages/AttributeTypes/Index.vue b/resources/js/Pages/AttributeTypes/Index.vue
new file mode 100644
index 0000000..76740f3
--- /dev/null
+++ b/resources/js/Pages/AttributeTypes/Index.vue
@@ -0,0 +1,33 @@
+
+
+
+
+
+ Attribute Types
+
+
+
+
+
+
{{
+ attributeType.title
+ }}
+
+
+
+
+
+
+
diff --git a/resources/js/Pages/Attributes/Edit.vue b/resources/js/Pages/Attributes/Edit.vue
index 9dae03b..15c3ff8 100644
--- a/resources/js/Pages/Attributes/Edit.vue
+++ b/resources/js/Pages/Attributes/Edit.vue
@@ -5,40 +5,35 @@ import InputLabel from '@/Components/InputLabel.vue';
import PrimaryButton from '@/Components/PrimaryButton.vue';
import TextInput from '@/Components/TextInput.vue';
import {Head, router, useForm} from '@inertiajs/vue3';
-import {marked} from 'marked';
-import {computed, ref} from "vue";
-import axios from "axios";
-import MarkDownTextArea from "@/CustomComponents/MarkDownTextArea.vue";
+import {Attribute, AttributeType} from "@/types";
const props = defineProps<{
- attributeType?: {
- id: number;
- title: string;
- description: string;
- color: string;
- };
- colors: string[];
+ attributeTypes: AttributeType[];
+ attribute?: Attribute;
}>();
const form = useForm({
- title: props.attributeType?.title ?? '',
- description: props.attributeType?.description ?? '',
- color: props.attributeType?.color ?? '',
- errors: {},
- processing: false,
+ title: props.attribute?.title ?? '',
+ description: props.attribute?.description ?? '',
+ attribute_type_id: props.attribute?.attribute_type_id ?? '',
});
-function capitalizeFirstLetter(string:string) {
+function capitalizeFirstLetter(string: string) {
return string[0].toUpperCase() + string.slice(1);
}
+
const submit = () => {
- router.post(route('attributes.store'), form.data());
+ if (props.attribute) {
+ router.put(route('attributes.update', props.attribute.id), form.data());
+ } else {
+ router.post(route('attributes.store'), form.data());
+ }
};
-
+
-
-
-
+
+
-
-
- Update item
+ Update Attribute
diff --git a/resources/js/Pages/Attributes/Index.vue b/resources/js/Pages/Attributes/Index.vue
new file mode 100644
index 0000000..8074811
--- /dev/null
+++ b/resources/js/Pages/Attributes/Index.vue
@@ -0,0 +1,36 @@
+
+
+
+
+
+ Attributes
+
+
+
+
+
+
+
{{
+ attribute.title
+ }}
+
+
+
+
+
+
+
+
+
diff --git a/resources/js/Pages/Dashboard.vue b/resources/js/Pages/Dashboard.vue
index 0282da7..6e7a60f 100644
--- a/resources/js/Pages/Dashboard.vue
+++ b/resources/js/Pages/Dashboard.vue
@@ -1,6 +1,10 @@
@@ -28,8 +32,15 @@ import {Head} from '@inertiajs/vue3';
+ hallo allemaal 1