finds.dev← search

// the find

taylorotwell/next-example-frontend

★ 324 · JavaScript · updated Nov 2021

The Next.js frontend half of Laravel Breeze's official Next/Laravel starter pair. It gives you auth pages (login, register, password reset, email verify) wired to a Laravel Sanctum backend via cookie-based sessions. Aimed at developers who want a Laravel API with a Next.js SPA and don't want to build the auth plumbing from scratch.

The `useAuth` hook is clean — it centralises redirect logic, SWR-based user fetching, and middleware guards in one place rather than scattering it across pages. Axios is pre-configured with CSRF cookie handling and withCredentials, which is the part most people get wrong when first pairing Next with Sanctum. The component split (GuestLayout vs AppLayout) is minimal and actually useful rather than over-abstracted.

Last commit was November 2021 — this is essentially abandoned. The Next.js Pages Router it's built on is the old model; App Router is now the default and this repo won't translate cleanly. There's no TypeScript, which makes adopting the hook patterns into a modern TS project manual work. The same-origin localhost caveat in the README signals that cross-origin cookie auth is not solved — anyone deploying frontend and backend to different domains will hit Sanctum CORS and cookie issues that aren't addressed here.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →