Skip to content

Commit 1b62d3b

Browse files
committed
Redo the login and recover password pages
1 parent 7ed5c44 commit 1b62d3b

21 files changed

+318
-1326
lines changed

app/Http/Controllers/Auth/AuthenticatedSessionController.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Illuminate\Http\RedirectResponse;
88
use Illuminate\Http\Request;
99
use Illuminate\Support\Facades\Auth;
10-
use Illuminate\Support\Facades\Route;
1110
use Inertia\Inertia;
1211
use Inertia\Response;
1312

@@ -18,9 +17,7 @@ class AuthenticatedSessionController extends Controller
1817
*/
1918
public function create(Request $request): Response
2019
{
21-
return Inertia::render('auth/Login', [
22-
'canResetPassword' => Route::has('password.request'),
23-
'status' => $request->session()->get('status'),
20+
return Inertia::render('auth/Login', ['status' => $request->session()->get('status'),
2421
]);
2522
}
2623

app/Http/Controllers/Auth/RegisteredUserController.php

Lines changed: 0 additions & 51 deletions
This file was deleted.

app/Http/Controllers/PublicController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ public function scheduleAppointment(StoreAppointmentSchedule $appSched)
4141
$animal->appointments()->create($appSched->getAppointmentData());
4242
});
4343

44-
return to_route('public.home');
44+
return to_route('home');
4545
}
4646
}

database/seeders/DatabaseSeeder.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use App\UserType;
1111
use Illuminate\Database\Eloquent\Factories\Sequence;
1212
use Illuminate\Database\Seeder;
13+
use Illuminate\Support\Facades\Hash;
1314

1415
class DatabaseSeeder extends Seeder
1516
{
@@ -53,5 +54,16 @@ public function run(): void
5354
'medic_id' => $medics->random()->id,
5455
]))
5556
->create();
57+
58+
// Demo users
59+
$password = Hash::make('password');
60+
User::factory()->receptionist()->create([
61+
'email' => '[email protected]',
62+
'password' => $password,
63+
]);
64+
User::factory()->medic()->create([
65+
'email' => '[email protected]',
66+
'password' => $password,
67+
]);
5668
}
5769
}

resources/js/app.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
import '../css/app.css';
22

3+
import { appName } from '@/lib/consts';
34
import { createInertiaApp } from '@inertiajs/vue3';
5+
import ui from '@nuxt/ui/vue-plugin';
46
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
57
import type { DefineComponent } from 'vue';
68
import { createApp, h } from 'vue';
79
import { ZiggyVue } from 'ziggy-js';
8-
import ui from "@nuxt/ui/vue-plugin"
910
import { initializeTheme } from './composables/useAppearance';
1011

1112
// Extend ImportMeta interface for Vite...
1213
declare module 'vite/client' {
1314
interface ImportMetaEnv {
1415
readonly VITE_APP_NAME: string;
16+
1517
[key: string]: string | boolean | undefined;
1618
}
1719

@@ -21,8 +23,6 @@ declare module 'vite/client' {
2123
}
2224
}
2325

24-
const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
25-
2626
createInertiaApp({
2727
title: (title) => `${title} - ${appName}`,
2828
resolve: (name) => resolvePageComponent(`./pages/${name}.vue`, import.meta.glob<DefineComponent>('./pages/**/*.vue')),

resources/js/layouts/AppLayout.vue

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
<script setup lang="ts">
2-
import AppLayout from '@/layouts/app/AppSidebarLayout.vue';
3-
import type { BreadcrumbItemType } from '@/types';
2+
import { Head } from '@inertiajs/vue3';
43
5-
interface Props {
6-
breadcrumbs?: BreadcrumbItemType[];
4+
export interface AppLayoutProps {
5+
pageTitle: string;
76
}
87
9-
withDefaults(defineProps<Props>(), {
10-
breadcrumbs: () => [],
11-
});
8+
defineProps<AppLayoutProps>();
129
</script>
1310

1411
<template>
15-
<AppLayout :breadcrumbs="breadcrumbs">
12+
<Head :title="pageTitle" />
13+
14+
<UApp>
1615
<slot />
17-
</AppLayout>
16+
</UApp>
1817
</template>

resources/js/layouts/AuthLayout.vue

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<script setup lang="ts">
2+
import AppLayout, { AppLayoutProps } from '@/layouts/AppLayout.vue';
3+
import { appName } from '@/lib/consts';
4+
5+
interface SingleCardLayoutProps extends AppLayoutProps {
6+
cardTitle?: string;
7+
cardSubtitle?: string;
8+
cardNoTitles?: boolean;
9+
}
10+
11+
interface SingleCardLayoutSlots {
12+
card(): any;
13+
14+
footer(): any;
15+
}
16+
17+
defineProps<SingleCardLayoutProps>();
18+
defineSlots<SingleCardLayoutSlots>();
19+
</script>
20+
21+
<template>
22+
<AppLayout v-bind="{ pageTitle }">
23+
<UContainer class="flex h-full flex-col items-center justify-center p-4 sm:p-6">
24+
<!-- Page header -->
25+
<UIcon name="i-lucide-hospital" class="mt-12 size-32" />
26+
<h1 class="mt-6 text-center text-5xl font-black">{{ appName }}</h1>
27+
28+
<!-- Card -->
29+
<UCard class="mt-16 sm:p-4">
30+
<!-- Card header -->
31+
<div v-if="!cardNoTitles && (cardTitle || cardSubtitle)" class="mt-6 mb-12 px-4 text-center sm:mt-0">
32+
<h2 v-if="cardTitle" class="text-4xl font-bold">{{ cardTitle }}</h2>
33+
<p v-if="cardSubtitle" class="mt-4">{{ cardSubtitle }}</p>
34+
</div>
35+
<slot name="card" />
36+
</UCard>
37+
38+
<div v-if="$slots.footer" class="mt-4">
39+
<slot name="footer" />
40+
</div>
41+
</UContainer>
42+
</AppLayout>
43+
</template>

resources/js/layouts/auth/AuthCardLayout.vue

Lines changed: 0 additions & 36 deletions
This file was deleted.

resources/js/layouts/auth/AuthSimpleLayout.vue

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)