Skip to content

Laravel Wayfinder #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
/public/storage
/public/css
/public/js
/resources/js/actions
/resources/js/routes
/resources/js/wayfinder
/storage/*.key
/vendor
.env
Expand Down
Binary file modified bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
"laravel/pulse": "^1.2",
"laravel/sanctum": "^4.0",
"laravel/tinker": "^2.9",
"laravel/wayfinder": "^0.1.5",
"pxlrbt/filament-environment-indicator": "^2.0",
"sentry/sentry-laravel": "^4.7",
"spatie/laravel-health": "^1.31",
"spatie/laravel-permission": "^6.9",
"spatie/security-advisories-health-check": "^1.2",
"symfony/http-client": "^7.2",
"symfony/postmark-mailer": "^7.2",
"tightenco/ziggy": "^2.3"
"symfony/postmark-mailer": "^7.2"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.13",
Expand Down
134 changes: 63 additions & 71 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"laravel-vite-plugin": "^1.2.0",
"tailwindcss": "^4.1.6",
"vite": "^6.3.5",
"vite-plugin-run": "^0.6.1",
"vue": "^3.5.13"
},
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion resources/css/utilities.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@utility text-link {
@apply underline hover:decoration-transparent transition-colors;
@apply underline cursor-pointer hover:decoration-transparent transition-colors;
}
4 changes: 3 additions & 1 deletion resources/js/Components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="flex items-center">
<Link
class="shrink-0 text-brand-800"
:href="route('home')"
:href="home()"
>
<SparklesIcon class="size-7" />
</Link>
Expand Down Expand Up @@ -85,6 +85,8 @@
import { ref, onMounted } from "vue";
import { router } from '@inertiajs/vue3';

import { index as home } from "@js/actions/App/Http/Controllers/DashboardController";

import {
Sparkles as SparklesIcon,
Menu as MenuIcon,
Expand Down
50 changes: 17 additions & 33 deletions resources/js/Layouts/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,50 +21,34 @@

<script setup>
import { computed, defineAsyncComponent } from "vue";
import { usePage } from '@inertiajs/vue3'

import { index as home } from "@js/actions/App/Http/Controllers/DashboardController";
import { edit as editAccount } from "@js/actions/App/Http/Controllers/AccountController";
import LogoutController from "@js/actions/App/Http/Controllers/LogoutController";

const Header = defineAsyncComponent(() => import("@js/Components/Header.vue"));
const Footer = defineAsyncComponent(() => import("@js/Components/Footer.vue"));

const page = usePage();

const menu = computed(() => {
if (page.props.auth.loggedIn) {
return [
{
label: "Dashboard",
route: route("home"),
condition: true,
components: ['Dashboard/Index'],
},
{
label: "Account",
route: route("account.edit"),
condition: true,
components: ['Account/Edit', 'EmailVerification/Show'],
},
{
label: "Logout",
route: route("logout"),
method: "post",
condition: true,
components: [],
},
];
}

return [
{
label: "Login",
route: route("login"),
label: "Dashboard",
route: home(),
condition: true,
components: ['Dashboard/Index'],
},
{
label: "Account",
route: editAccount(),
condition: true,
components: ['Login/Show'],
components: ['Account/Edit', 'EmailVerification/Show'],
},
{
label: "Register",
route: route("register"),
label: "Logout",
route: LogoutController(),
method: "post",
condition: true,
components: ['Register/Show'],
components: [],
},
];
});
Expand Down
5 changes: 4 additions & 1 deletion resources/js/Pages/Account/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@
import { ref } from "vue";
import { useForm } from "@inertiajs/vue3";

import { update } from "@js/actions/App/Http/Controllers/AccountController";

const title = ref("Update Account");
const props = defineProps({
user: Object,
Expand All @@ -103,8 +105,9 @@
});

const submitForm = () => {
accountForm.patch(route("account.update"), {
accountForm.submit(update(), {
preserveScroll: true,
preserveState: 'errors',
});
};
</script>
19 changes: 17 additions & 2 deletions resources/js/Pages/EmailVerification/Show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@
</button>
</div>
</div>

<div class="mt-6 xl:mt-10">
<p class="text-center mt-3">
<Link
class="text-link"
:href="LogoutController()"
method="post"
as="button"
>
Logout
</Link>
</p>
</div>
</div>
</template>

Expand All @@ -36,12 +49,14 @@
import { ref } from "vue";
import { router } from "@inertiajs/vue3";

import LogoutController from "@js/actions/App/Http/Controllers/LogoutController";
import { update } from "@js/actions/App/Http/Controllers/EmailVerificationController";

const title = ref("Verify Your Email");

const resend = () => {
router.post(route('verification.send'), {
router.post(update().url, {
preserveScroll: true,
preserveState: true,
});
};
</script>
10 changes: 7 additions & 3 deletions resources/js/Pages/Login/Show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
Password
<Link
class="text-link"
:href="route('password')"
:href="forgotPassword()"
text="Forgot password?"
/>
</label>
Expand Down Expand Up @@ -79,7 +79,7 @@
Don't have an account?
<Link
class="text-link"
:href="route('register')"
:href="register()"
text="Register"
/>
</p>
Expand All @@ -100,6 +100,10 @@
import { ref } from "vue";
import { useForm } from "@inertiajs/vue3";

import { show as forgotPassword } from "@js/actions/App/Http/Controllers/ResetPasswordController";
import { show as register } from "@js/actions/App/Http/Controllers/RegisterController";
import { store } from "@js/actions/App/Http/Controllers/LoginController";

const props = defineProps({
email: String,
password: String,
Expand All @@ -116,6 +120,6 @@
});

const submitForm = () => {
loginForm.post(route("login.store"));
loginForm.submit(store());
};
</script>
Loading