87 lines
3.5 KiB
Vue
87 lines
3.5 KiB
Vue
<script setup>
|
|
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue';
|
|
import InputError from '@/Components/InputError.vue';
|
|
import InputLabel from '@/Components/InputLabel.vue';
|
|
import PrimaryButton from '@/Components/PrimaryButton.vue';
|
|
import TextInput from '@/Components/TextInput.vue';
|
|
import { Head, useForm } from '@inertiajs/vue3';
|
|
|
|
const form = useForm({
|
|
name: '',
|
|
slug: '',
|
|
domain: '',
|
|
is_active: true,
|
|
});
|
|
|
|
const submit = () => {
|
|
form.post(route('superadmin.store'));
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<Head title="Créer une Structure" />
|
|
|
|
<AuthenticatedLayout>
|
|
<template #header>
|
|
<h2 class="text-xl font-semibold leading-tight text-gray-800 dark:text-gray-200">
|
|
Créer une nouvelle Structure (Tenant)
|
|
</h2>
|
|
</template>
|
|
|
|
<div class="py-12">
|
|
<div class="mx-auto max-w-7xl sm:px-6 lg:px-8">
|
|
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg">
|
|
<div class="p-6">
|
|
<form @submit.prevent="submit" class="max-w-xl space-y-6">
|
|
<div>
|
|
<InputLabel for="name" value="Nom de l'organisation" />
|
|
<TextInput
|
|
id="name"
|
|
type="text"
|
|
class="mt-1 block w-full"
|
|
v-model="form.name"
|
|
required
|
|
autofocus
|
|
/>
|
|
<InputError class="mt-2" :message="form.errors.name" />
|
|
</div>
|
|
|
|
<div>
|
|
<InputLabel for="slug" value="Slug (Identifiant URL)" />
|
|
<TextInput
|
|
id="slug"
|
|
type="text"
|
|
class="mt-1 block w-full"
|
|
v-model="form.slug"
|
|
required
|
|
/>
|
|
<InputError class="mt-2" :message="form.errors.slug" />
|
|
</div>
|
|
|
|
<div>
|
|
<InputLabel for="domain" value="Domaine personnalisé (Optionnel)" />
|
|
<TextInput
|
|
id="domain"
|
|
type="text"
|
|
class="mt-1 block w-full"
|
|
v-model="form.domain"
|
|
/>
|
|
<InputError class="mt-2" :message="form.errors.domain" />
|
|
</div>
|
|
|
|
<div class="flex items-center space-x-2">
|
|
<input type="checkbox" id="is_active" v-model="form.is_active" class="rounded border-gray-300 text-indigo-600 shadow-sm focus:ring-indigo-500">
|
|
<InputLabel for="is_active" value="Structure active" />
|
|
</div>
|
|
|
|
<div class="flex items-center gap-4">
|
|
<PrimaryButton :disabled="form.processing">Créer</PrimaryButton>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</AuthenticatedLayout>
|
|
</template>
|