Download the PHP package aliziodev/laravel-next-starter-kit without Composer

On this page you can find all versions of the php package aliziodev/laravel-next-starter-kit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-next-starter-kit

Laravel + Next.js Starter Kit

tests lint e2e Packagist Version Packagist Downloads next-sanctum License: MIT

A decoupled starter kit: a headless Laravel API and a separate Next.js (App Router) frontend, wired together with Laravel Fortify + Sanctum and the next-sanctum client.

It mirrors the UI and feature set of the official laravel/react-starter-kit, but instead of Inertia it ships an independent SPA that talks to Laravel over a same-origin proxy (no CORS).

Architecture

The browser only ever talks to the Next.js origin. The route handler forwards requests to Laravel carrying the session cookie and Origin/Referer, so Sanctum treats the SPA as first-party (stateful) — no CORS. Server Components authenticate directly via getUser() / serverFetch() from next-sanctum/server.

Login (cookie/SPA) flow

Auth boundaries

Protected pages live in an (app) route group whose layout calls getUser() once and redirects guests to /login — the decoupled equivalent of Route::middleware('auth')->group(...); auth pages live in (auth). Only those groups mount the Sanctum provider, so public pages (e.g. the welcome page) stay provider-free. The authoritative security boundary is the API itself (auth:sanctum); proxy.ts is only an optimistic edge fast-path.

Features

Requirements

Quick start

Open http://localhost:3000 and register an account. The API runs on http://localhost:8000.

Laravel installer prompts: when laravel new asks "run npm install --ignore-scripts and npm run build?", answer no — this kit's frontend lives in web/ (pnpm) and is installed in step 2. A tests.yml warning is harmless (this kit's CI workflow is e2e.yml). Choose Pest when asked for a testing framework (this kit's backend tests use Pest); Laravel Boost is optional (dev-only AI tooling).

The root package.json only delegates dev/build to web/, so composer run dev keeps working even though the installer rewrites its dev script to call npm run dev.

Already have a clone? Run composer run setup once to copy env files, generate the app key, migrate, and install the web dependencies.

Project structure

Environment

Backend (.env):

Variable Purpose
FRONTEND_URL Where email links (verify / reset) point back to (the SPA).
SANCTUM_STATEFUL_DOMAINS First-party origins for cookie auth — must list :3000 + :8000.
SESSION_DRIVER=database Required for the cookie/SPA flow.
SESSION_COOKIE Pinned to laravel_session for the proxy's cookie check.

Frontend (web/.env.local):

Variable Purpose
NEXT_PUBLIC_SANCTUM_BASE_URL Client base URL → the same-origin proxy (/api/sanctum).
SANCTUM_BASE_URL Server-only upstream → the real Laravel origin.

Deployment (Docker)

Even though the stack is two runtimes (Node + PHP), Docker Compose turns it into one command — you never run Node or PHP yourself. Thanks to the same-origin proxy, only the Next.js container is public; Laravel, MySQL, and the workers stay on the internal network.

Prerequisite: Docker + Docker Compose.

Open http://localhost:3000. That's it — on first boot the stack generates APP_KEY, runs migrations, and builds the prod caches (config/route/event) automatically.

Service Role Public?
frontend Next.js (standalone build) ✅ yes
api nginx → php-fpm (Laravel) no
php Laravel (php-fpm) — migrates + caches on boot no
queue queue:work (verification / reset emails) no
scheduler schedule:work no
db MySQL 8 no

Before a real (public) deploy, edit .env.docker:

Put a TLS reverse proxy (Caddy / Traefik / your platform) in front of frontend. The same docker-compose.yml also deploys as-is on PaaS that consume Compose files (e.g. Coolify, Railway), so you can skip managing a server entirely.

Redis is optional. Session / cache / queue default to the database driver (zero extra services). Switch SESSION_DRIVER / CACHE_STORE / QUEUE_CONNECTION to redis and add a redis service if you want it.

Security

Testing

End-to-end (Playwright, Chromium) — drives the full stack and covers login, invalid credentials, registration, logout, the passkey ceremony (register + passwordless sign-in, via a CDP virtual authenticator), 2FA (enable + login challenge, via a computed TOTP), and browser sessions (a second device's session listed + logged out). No real device is needed.

Locally the suite reuses already-running dev servers; in CI it boots them itself. GitHub Actions runs it on every push / PR (.github/workflows/e2e.yml).

Backend (Pest):

Lint & format:

All three suites run in GitHub Actions on every push / PR — tests.yml (Pest, PHP 8.4/8.5), lint.yml (Pint + ESLint + Prettier), and e2e.yml (Playwright).

Email verification

Email verification is off by default, matching the official Laravel starter kit. To enable it:

  1. In web/lib/email-verification.ts, set MUST_VERIFY_EMAIL = true.
  2. In app/Models/User.php, uncomment the MustVerifyEmail import and add it to the implements list so Fortify sends verification emails.

The verify-email pages and the resend flow ship ready to use; the flag simply gates the UI enforcement.

License

MIT.


All versions of laravel-next-starter-kit with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
laravel/fortify Version ^1.37
laravel/framework Version ^13.8
laravel/passkeys Version ^0.2.1
laravel/sanctum Version ^4.3
laravel/tinker Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package aliziodev/laravel-next-starter-kit contains the following files

Loading the files please wait ...