initial commit
This commit is contained in:
32
resources/js/pages/Dashboard.vue
Normal file
32
resources/js/pages/Dashboard.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<Head title="Dashboard" />
|
||||
|
||||
<Layout>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1>Latest Sales:</h1>
|
||||
<div v-for="sale in latestSales" :key="sale.id">
|
||||
<SaleCard class="mb-3" :sale="sale" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<AveragesChart />
|
||||
</div>
|
||||
</div>
|
||||
</Layout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import Layout from '@/layouts/AppLayout.vue';
|
||||
import SaleCard from '@/components/SaleCard.vue';
|
||||
import AveragesChart from '@/components/AveragesChart.vue';
|
||||
|
||||
const props = defineProps({
|
||||
latestSales: {
|
||||
type: Array,
|
||||
default: [],
|
||||
}
|
||||
});
|
||||
</script>
|
||||
21
resources/js/pages/Sale.vue
Normal file
21
resources/js/pages/Sale.vue
Normal file
@@ -0,0 +1,21 @@
|
||||
<template>
|
||||
<Layout>
|
||||
|
||||
<SaleCard :sale="sale" :detailed="true" />
|
||||
<Link :href="route('dashboard')">Back</Link>
|
||||
|
||||
</Layout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { Link } from '@inertiajs/vue3';
|
||||
import Layout from '@/layouts/AppLayout.vue';
|
||||
import SaleCard from '@/components/SaleCard.vue';
|
||||
|
||||
const props = defineProps({
|
||||
sale: {
|
||||
type: Object,
|
||||
default: {},
|
||||
}
|
||||
});
|
||||
</script>
|
||||
53
resources/js/pages/auth/ConfirmPassword.vue
Normal file
53
resources/js/pages/auth/ConfirmPassword.vue
Normal file
@@ -0,0 +1,53 @@
|
||||
<script setup lang="ts">
|
||||
import InputError from '@/components/InputError.vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import AuthLayout from '@/layouts/AuthLayout.vue';
|
||||
import { Head, useForm } from '@inertiajs/vue3';
|
||||
import { LoaderCircle } from 'lucide-vue-next';
|
||||
|
||||
const form = useForm({
|
||||
password: '',
|
||||
});
|
||||
|
||||
const submit = () => {
|
||||
form.post(route('password.confirm'), {
|
||||
onFinish: () => {
|
||||
form.reset();
|
||||
},
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthLayout title="Confirm your password" description="This is a secure area of the application. Please confirm your password before continuing.">
|
||||
<Head title="Confirm password" />
|
||||
|
||||
<form @submit.prevent="submit">
|
||||
<div class="space-y-6">
|
||||
<div class="grid gap-2">
|
||||
<Label htmlFor="password">Password</Label>
|
||||
<Input
|
||||
id="password"
|
||||
type="password"
|
||||
class="mt-1 block w-full"
|
||||
v-model="form.password"
|
||||
required
|
||||
autocomplete="current-password"
|
||||
autofocus
|
||||
/>
|
||||
|
||||
<InputError :message="form.errors.password" />
|
||||
</div>
|
||||
|
||||
<div class="flex items-center">
|
||||
<Button class="w-full" :disabled="form.processing">
|
||||
<LoaderCircle v-if="form.processing" class="h-4 w-4 animate-spin" />
|
||||
Confirm Password
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</AuthLayout>
|
||||
</template>
|
||||
54
resources/js/pages/auth/ForgotPassword.vue
Normal file
54
resources/js/pages/auth/ForgotPassword.vue
Normal file
@@ -0,0 +1,54 @@
|
||||
<script setup lang="ts">
|
||||
import InputError from '@/components/InputError.vue';
|
||||
import TextLink from '@/components/TextLink.vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import AuthLayout from '@/layouts/AuthLayout.vue';
|
||||
import { Head, useForm } from '@inertiajs/vue3';
|
||||
import { LoaderCircle } from 'lucide-vue-next';
|
||||
|
||||
defineProps<{
|
||||
status?: string;
|
||||
}>();
|
||||
|
||||
const form = useForm({
|
||||
email: '',
|
||||
});
|
||||
|
||||
const submit = () => {
|
||||
form.post(route('password.email'));
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthLayout title="Forgot password" description="Enter your email to receive a password reset link">
|
||||
<Head title="Forgot password" />
|
||||
|
||||
<div v-if="status" class="mb-4 text-center text-sm font-medium text-green-600">
|
||||
{{ status }}
|
||||
</div>
|
||||
|
||||
<div class="space-y-6">
|
||||
<form @submit.prevent="submit">
|
||||
<div class="grid gap-2">
|
||||
<Label for="email">Email address</Label>
|
||||
<Input id="email" type="email" name="email" autocomplete="off" v-model="form.email" autofocus placeholder="email@example.com" />
|
||||
<InputError :message="form.errors.email" />
|
||||
</div>
|
||||
|
||||
<div class="my-6 flex items-center justify-start">
|
||||
<Button class="w-full" :disabled="form.processing">
|
||||
<LoaderCircle v-if="form.processing" class="h-4 w-4 animate-spin" />
|
||||
Email password reset link
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="space-x-1 text-center text-sm text-muted-foreground">
|
||||
<span>Or, return to</span>
|
||||
<TextLink :href="route('login')">log in</TextLink>
|
||||
</div>
|
||||
</div>
|
||||
</AuthLayout>
|
||||
</template>
|
||||
71
resources/js/pages/auth/Login.vue
Normal file
71
resources/js/pages/auth/Login.vue
Normal file
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<Layout title="Log in to your account" description="Enter your email and password below to log in">
|
||||
|
||||
<Head title="Log in" />
|
||||
|
||||
<div v-if="status" class="mb-4 text-center text-sm font-medium text-green-600">
|
||||
{{ status }}
|
||||
</div>
|
||||
|
||||
<form @submit.prevent="submit" class="d-flex flex-column gap-3">
|
||||
<TextInput
|
||||
label="Email Address"
|
||||
v-model="form.email" />
|
||||
<InputError :message="form.errors.email" />
|
||||
|
||||
<TextInput
|
||||
label="Password"
|
||||
v-model="form.password"
|
||||
type="password" />
|
||||
<InputError :message="form.errors.password" />
|
||||
|
||||
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<Label for="remember" class="flex items-center space-x-3">
|
||||
<Checkbox id="remember" v-model="form.remember" :tabindex="3" />
|
||||
<span>Remember me</span>
|
||||
</Label>
|
||||
</div>
|
||||
|
||||
<Button type="submit" class="mt-4 w-full" :tabindex="4" :disabled="form.processing">
|
||||
<LoaderCircle v-if="form.processing" class="h-4 w-4 animate-spin" />
|
||||
Log in
|
||||
</Button>
|
||||
|
||||
<div class="text-center text-sm text-muted-foreground">
|
||||
Don't have an account?
|
||||
<TextLink :href="route('register')" :tabindex="5">Sign up</TextLink>
|
||||
</div>
|
||||
</form>
|
||||
</Layout>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import InputError from '@/components/InputError.vue';
|
||||
import TextInput from '@/components/TextInput.vue';
|
||||
import TextLink from '@/components/TextLink.vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Checkbox } from '@/components/ui/checkbox';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import Layout from '@/layouts/AuthLayout.vue';
|
||||
import { Head, useForm } from '@inertiajs/vue3';
|
||||
import { LoaderCircle } from 'lucide-vue-next';
|
||||
|
||||
defineProps<{
|
||||
status?: string;
|
||||
canResetPassword: boolean;
|
||||
}>();
|
||||
|
||||
const form = useForm({
|
||||
email: '',
|
||||
password: '',
|
||||
remember: false,
|
||||
});
|
||||
|
||||
const submit = () => {
|
||||
form.post(route('login'), {
|
||||
onFinish: () => form.reset('password'),
|
||||
});
|
||||
};
|
||||
</script>
|
||||
83
resources/js/pages/auth/Register.vue
Normal file
83
resources/js/pages/auth/Register.vue
Normal file
@@ -0,0 +1,83 @@
|
||||
<script setup lang="ts">
|
||||
import InputError from '@/components/InputError.vue';
|
||||
import TextLink from '@/components/TextLink.vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import AuthBase from '@/layouts/AuthLayout.vue';
|
||||
import { Head, useForm } from '@inertiajs/vue3';
|
||||
import { LoaderCircle } from 'lucide-vue-next';
|
||||
|
||||
const form = useForm({
|
||||
name: '',
|
||||
email: '',
|
||||
password: '',
|
||||
password_confirmation: '',
|
||||
});
|
||||
|
||||
const submit = () => {
|
||||
form.post(route('register'), {
|
||||
onFinish: () => form.reset('password', 'password_confirmation'),
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthBase title="Create an account" description="Enter your details below to create your account">
|
||||
<Head title="Register" />
|
||||
|
||||
<form @submit.prevent="submit" class="flex flex-col gap-6">
|
||||
<div class="grid gap-6">
|
||||
<div class="grid gap-2">
|
||||
<Label for="name">Name</Label>
|
||||
<Input id="name" type="text" required autofocus :tabindex="1" autocomplete="name" v-model="form.name" placeholder="Full name" />
|
||||
<InputError :message="form.errors.name" />
|
||||
</div>
|
||||
|
||||
<div class="grid gap-2">
|
||||
<Label for="email">Email address</Label>
|
||||
<Input id="email" type="email" required :tabindex="2" autocomplete="email" v-model="form.email" placeholder="email@example.com" />
|
||||
<InputError :message="form.errors.email" />
|
||||
</div>
|
||||
|
||||
<div class="grid gap-2">
|
||||
<Label for="password">Password</Label>
|
||||
<Input
|
||||
id="password"
|
||||
type="password"
|
||||
required
|
||||
:tabindex="3"
|
||||
autocomplete="new-password"
|
||||
v-model="form.password"
|
||||
placeholder="Password"
|
||||
/>
|
||||
<InputError :message="form.errors.password" />
|
||||
</div>
|
||||
|
||||
<div class="grid gap-2">
|
||||
<Label for="password_confirmation">Confirm password</Label>
|
||||
<Input
|
||||
id="password_confirmation"
|
||||
type="password"
|
||||
required
|
||||
:tabindex="4"
|
||||
autocomplete="new-password"
|
||||
v-model="form.password_confirmation"
|
||||
placeholder="Confirm password"
|
||||
/>
|
||||
<InputError :message="form.errors.password_confirmation" />
|
||||
</div>
|
||||
|
||||
<Button type="submit" class="mt-2 w-full" tabindex="5" :disabled="form.processing">
|
||||
<LoaderCircle v-if="form.processing" class="h-4 w-4 animate-spin" />
|
||||
Create account
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div class="text-center text-sm text-muted-foreground">
|
||||
Already have an account?
|
||||
<TextLink :href="route('login')" class="underline underline-offset-4" :tabindex="6">Log in</TextLink>
|
||||
</div>
|
||||
</form>
|
||||
</AuthBase>
|
||||
</template>
|
||||
81
resources/js/pages/auth/ResetPassword.vue
Normal file
81
resources/js/pages/auth/ResetPassword.vue
Normal file
@@ -0,0 +1,81 @@
|
||||
<script setup lang="ts">
|
||||
import InputError from '@/components/InputError.vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import AuthLayout from '@/layouts/AuthLayout.vue';
|
||||
import { Head, useForm } from '@inertiajs/vue3';
|
||||
import { LoaderCircle } from 'lucide-vue-next';
|
||||
|
||||
interface Props {
|
||||
token: string;
|
||||
email: string;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
const form = useForm({
|
||||
token: props.token,
|
||||
email: props.email,
|
||||
password: '',
|
||||
password_confirmation: '',
|
||||
});
|
||||
|
||||
const submit = () => {
|
||||
form.post(route('password.store'), {
|
||||
onFinish: () => {
|
||||
form.reset('password', 'password_confirmation');
|
||||
},
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthLayout title="Reset password" description="Please enter your new password below">
|
||||
<Head title="Reset password" />
|
||||
|
||||
<form @submit.prevent="submit">
|
||||
<div class="grid gap-6">
|
||||
<div class="grid gap-2">
|
||||
<Label for="email">Email</Label>
|
||||
<Input id="email" type="email" name="email" autocomplete="email" v-model="form.email" class="mt-1 block w-full" readonly />
|
||||
<InputError :message="form.errors.email" class="mt-2" />
|
||||
</div>
|
||||
|
||||
<div class="grid gap-2">
|
||||
<Label for="password">Password</Label>
|
||||
<Input
|
||||
id="password"
|
||||
type="password"
|
||||
name="password"
|
||||
autocomplete="new-password"
|
||||
v-model="form.password"
|
||||
class="mt-1 block w-full"
|
||||
autofocus
|
||||
placeholder="Password"
|
||||
/>
|
||||
<InputError :message="form.errors.password" />
|
||||
</div>
|
||||
|
||||
<div class="grid gap-2">
|
||||
<Label for="password_confirmation"> Confirm Password </Label>
|
||||
<Input
|
||||
id="password_confirmation"
|
||||
type="password"
|
||||
name="password_confirmation"
|
||||
autocomplete="new-password"
|
||||
v-model="form.password_confirmation"
|
||||
class="mt-1 block w-full"
|
||||
placeholder="Confirm password"
|
||||
/>
|
||||
<InputError :message="form.errors.password_confirmation" />
|
||||
</div>
|
||||
|
||||
<Button type="submit" class="mt-4 w-full" :disabled="form.processing">
|
||||
<LoaderCircle v-if="form.processing" class="h-4 w-4 animate-spin" />
|
||||
Reset password
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
</AuthLayout>
|
||||
</template>
|
||||
36
resources/js/pages/auth/VerifyEmail.vue
Normal file
36
resources/js/pages/auth/VerifyEmail.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<script setup lang="ts">
|
||||
import TextLink from '@/components/TextLink.vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import AuthLayout from '@/layouts/AuthLayout.vue';
|
||||
import { Head, useForm } from '@inertiajs/vue3';
|
||||
import { LoaderCircle } from 'lucide-vue-next';
|
||||
|
||||
defineProps<{
|
||||
status?: string;
|
||||
}>();
|
||||
|
||||
const form = useForm({});
|
||||
|
||||
const submit = () => {
|
||||
form.post(route('verification.send'));
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthLayout title="Verify email" description="Please verify your email address by clicking on the link we just emailed to you.">
|
||||
<Head title="Email verification" />
|
||||
|
||||
<div v-if="status === 'verification-link-sent'" class="mb-4 text-center text-sm font-medium text-green-600">
|
||||
A new verification link has been sent to the email address you provided during registration.
|
||||
</div>
|
||||
|
||||
<form @submit.prevent="submit" class="space-y-6 text-center">
|
||||
<Button :disabled="form.processing" variant="secondary">
|
||||
<LoaderCircle v-if="form.processing" class="h-4 w-4 animate-spin" />
|
||||
Resend verification email
|
||||
</Button>
|
||||
|
||||
<TextLink :href="route('logout')" method="post" as="button" class="mx-auto block text-sm"> Log out </TextLink>
|
||||
</form>
|
||||
</AuthLayout>
|
||||
</template>
|
||||
30
resources/js/pages/settings/Appearance.vue
Normal file
30
resources/js/pages/settings/Appearance.vue
Normal file
@@ -0,0 +1,30 @@
|
||||
<script setup lang="ts">
|
||||
import { Head } from '@inertiajs/vue3';
|
||||
|
||||
import AppearanceTabs from '@/components/AppearanceTabs.vue';
|
||||
import HeadingSmall from '@/components/HeadingSmall.vue';
|
||||
import { type BreadcrumbItem } from '@/types';
|
||||
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import SettingsLayout from '@/layouts/settings/Layout.vue';
|
||||
|
||||
const breadcrumbItems: BreadcrumbItem[] = [
|
||||
{
|
||||
title: 'Appearance settings',
|
||||
href: '/settings/appearance',
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppLayout :breadcrumbs="breadcrumbItems">
|
||||
<Head title="Appearance settings" />
|
||||
|
||||
<SettingsLayout>
|
||||
<div class="space-y-6">
|
||||
<HeadingSmall title="Appearance settings" description="Update your account's appearance settings" />
|
||||
<AppearanceTabs />
|
||||
</div>
|
||||
</SettingsLayout>
|
||||
</AppLayout>
|
||||
</template>
|
||||
119
resources/js/pages/settings/Password.vue
Normal file
119
resources/js/pages/settings/Password.vue
Normal file
@@ -0,0 +1,119 @@
|
||||
<script setup lang="ts">
|
||||
import InputError from '@/components/InputError.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import SettingsLayout from '@/layouts/settings/Layout.vue';
|
||||
import { Head, useForm } from '@inertiajs/vue3';
|
||||
import { ref } from 'vue';
|
||||
|
||||
import HeadingSmall from '@/components/HeadingSmall.vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { type BreadcrumbItem } from '@/types';
|
||||
|
||||
const breadcrumbItems: BreadcrumbItem[] = [
|
||||
{
|
||||
title: 'Password settings',
|
||||
href: '/settings/password',
|
||||
},
|
||||
];
|
||||
|
||||
const passwordInput = ref<HTMLInputElement | null>(null);
|
||||
const currentPasswordInput = ref<HTMLInputElement | null>(null);
|
||||
|
||||
const form = useForm({
|
||||
current_password: '',
|
||||
password: '',
|
||||
password_confirmation: '',
|
||||
});
|
||||
|
||||
const updatePassword = () => {
|
||||
form.put(route('password.update'), {
|
||||
preserveScroll: true,
|
||||
onSuccess: () => form.reset(),
|
||||
onError: (errors: any) => {
|
||||
if (errors.password) {
|
||||
form.reset('password', 'password_confirmation');
|
||||
if (passwordInput.value instanceof HTMLInputElement) {
|
||||
passwordInput.value.focus();
|
||||
}
|
||||
}
|
||||
|
||||
if (errors.current_password) {
|
||||
form.reset('current_password');
|
||||
if (currentPasswordInput.value instanceof HTMLInputElement) {
|
||||
currentPasswordInput.value.focus();
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppLayout :breadcrumbs="breadcrumbItems">
|
||||
<Head title="Password settings" />
|
||||
|
||||
<SettingsLayout>
|
||||
<div class="space-y-6">
|
||||
<HeadingSmall title="Update password" description="Ensure your account is using a long, random password to stay secure" />
|
||||
|
||||
<form @submit.prevent="updatePassword" class="space-y-6">
|
||||
<div class="grid gap-2">
|
||||
<Label for="current_password">Current password</Label>
|
||||
<Input
|
||||
id="current_password"
|
||||
ref="currentPasswordInput"
|
||||
v-model="form.current_password"
|
||||
type="password"
|
||||
class="mt-1 block w-full"
|
||||
autocomplete="current-password"
|
||||
placeholder="Current password"
|
||||
/>
|
||||
<InputError :message="form.errors.current_password" />
|
||||
</div>
|
||||
|
||||
<div class="grid gap-2">
|
||||
<Label for="password">New password</Label>
|
||||
<Input
|
||||
id="password"
|
||||
ref="passwordInput"
|
||||
v-model="form.password"
|
||||
type="password"
|
||||
class="mt-1 block w-full"
|
||||
autocomplete="new-password"
|
||||
placeholder="New password"
|
||||
/>
|
||||
<InputError :message="form.errors.password" />
|
||||
</div>
|
||||
|
||||
<div class="grid gap-2">
|
||||
<Label for="password_confirmation">Confirm password</Label>
|
||||
<Input
|
||||
id="password_confirmation"
|
||||
v-model="form.password_confirmation"
|
||||
type="password"
|
||||
class="mt-1 block w-full"
|
||||
autocomplete="new-password"
|
||||
placeholder="Confirm password"
|
||||
/>
|
||||
<InputError :message="form.errors.password_confirmation" />
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-4">
|
||||
<Button :disabled="form.processing">Save password</Button>
|
||||
|
||||
<Transition
|
||||
enter-active-class="transition ease-in-out"
|
||||
enter-from-class="opacity-0"
|
||||
leave-active-class="transition ease-in-out"
|
||||
leave-to-class="opacity-0"
|
||||
>
|
||||
<p v-show="form.recentlySuccessful" class="text-sm text-neutral-600">Saved.</p>
|
||||
</Transition>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</SettingsLayout>
|
||||
</AppLayout>
|
||||
</template>
|
||||
108
resources/js/pages/settings/Profile.vue
Normal file
108
resources/js/pages/settings/Profile.vue
Normal file
@@ -0,0 +1,108 @@
|
||||
<script setup lang="ts">
|
||||
import { Head, Link, useForm, usePage } from '@inertiajs/vue3';
|
||||
|
||||
import DeleteUser from '@/components/DeleteUser.vue';
|
||||
import HeadingSmall from '@/components/HeadingSmall.vue';
|
||||
import InputError from '@/components/InputError.vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import SettingsLayout from '@/layouts/settings/Layout.vue';
|
||||
import { type BreadcrumbItem, type SharedData, type User } from '@/types';
|
||||
|
||||
interface Props {
|
||||
mustVerifyEmail: boolean;
|
||||
status?: string;
|
||||
}
|
||||
|
||||
defineProps<Props>();
|
||||
|
||||
const breadcrumbs: BreadcrumbItem[] = [
|
||||
{
|
||||
title: 'Profile settings',
|
||||
href: '/settings/profile',
|
||||
},
|
||||
];
|
||||
|
||||
const page = usePage<SharedData>();
|
||||
const user = page.props.auth.user as User;
|
||||
|
||||
const form = useForm({
|
||||
name: user.name,
|
||||
email: user.email,
|
||||
});
|
||||
|
||||
const submit = () => {
|
||||
form.patch(route('profile.update'), {
|
||||
preserveScroll: true,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<Head title="Profile settings" />
|
||||
|
||||
<SettingsLayout>
|
||||
<div class="flex flex-col space-y-6">
|
||||
<HeadingSmall title="Profile information" description="Update your name and email address" />
|
||||
|
||||
<form @submit.prevent="submit" class="space-y-6">
|
||||
<div class="grid gap-2">
|
||||
<Label for="name">Name</Label>
|
||||
<Input id="name" class="mt-1 block w-full" v-model="form.name" required autocomplete="name" placeholder="Full name" />
|
||||
<InputError class="mt-2" :message="form.errors.name" />
|
||||
</div>
|
||||
|
||||
<div class="grid gap-2">
|
||||
<Label for="email">Email address</Label>
|
||||
<Input
|
||||
id="email"
|
||||
type="email"
|
||||
class="mt-1 block w-full"
|
||||
v-model="form.email"
|
||||
required
|
||||
autocomplete="username"
|
||||
placeholder="Email address"
|
||||
/>
|
||||
<InputError class="mt-2" :message="form.errors.email" />
|
||||
</div>
|
||||
|
||||
<div v-if="mustVerifyEmail && !user.email_verified_at">
|
||||
<p class="-mt-4 text-sm text-muted-foreground">
|
||||
Your email address is unverified.
|
||||
<Link
|
||||
:href="route('verification.send')"
|
||||
method="post"
|
||||
as="button"
|
||||
class="text-foreground underline decoration-neutral-300 underline-offset-4 transition-colors duration-300 ease-out hover:decoration-current! dark:decoration-neutral-500"
|
||||
>
|
||||
Click here to resend the verification email.
|
||||
</Link>
|
||||
</p>
|
||||
|
||||
<div v-if="status === 'verification-link-sent'" class="mt-2 text-sm font-medium text-green-600">
|
||||
A new verification link has been sent to your email address.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-4">
|
||||
<Button :disabled="form.processing">Save</Button>
|
||||
|
||||
<Transition
|
||||
enter-active-class="transition ease-in-out"
|
||||
enter-from-class="opacity-0"
|
||||
leave-active-class="transition ease-in-out"
|
||||
leave-to-class="opacity-0"
|
||||
>
|
||||
<p v-show="form.recentlySuccessful" class="text-sm text-neutral-600">Saved.</p>
|
||||
</Transition>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<DeleteUser />
|
||||
</SettingsLayout>
|
||||
</AppLayout>
|
||||
</template>
|
||||
Reference in New Issue
Block a user