百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

laravel-nuxt

> 前端框架
开源

⚡ Laravel 和 Nuxt.js 套件专为开发而设计,具有最高的 API 性能、预先定义的授权方法、优化的图片上传功能以及用户自定义的模板。

343 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

⚡ Laravel 和 Nuxt.js 套件专为开发而设计,具有最高的 API 性能、预先定义的授权方法、优化的图片上传功能以及用户自定义的模板。

⚡ Laravel Nuxt Boilerplate

The goal of the project is to create a template for development on Laravel and Nuxt with maximum API performance, ready-made authorization methods, image uploading with optimization and ready-made user roles.

  • Features
  • Requirements
  • Installation
    • Standalone
    • Docker
  • Usage
    • Fetch wrapper
    • Authentication
    • Nuxt Middleware
    • Laravel Middleware
  • Examples
    • Route list
    • Demo
  • Links
  • License

Features

  • Laravel 13 and Nuxt 4
  • Laravel Octane supercharges your application's performance by serving your application using high-powered application servers.
  • Laravel Socialite OAuth providers
  • Laravel Sail Light-weight command-line interface for interacting with Laravel's default Docker development environment.
  • Spatie Laravel Permissions This package allows you to manage user permissions and roles in a database.
  • Pest Elegant testing framework with expressive syntax and zero-config Laravel integration.
  • UI library Nuxt UI 4 based on TailwindCSS 4 and Reka UI.
  • Pinia The intuitive store for Vue.js
  • Integrated pages: login, registration, password recovery, email confirmation, account information update, password change.
  • Temporary uploads with cropping and optimization of images.
  • Device management
  • Enhanced Fetch Wrappers : Utilizes $http and useHttp, which extend the capabilities of Nuxt's standard $fetch and useFetch.
  • Monorepo layout (apps/api + apps/web) with just task runner.

Requirements

  • PHP 8.4+ / Node 20+ (or Bun)
  • Redis is required for the Throttling with Redis feature
  • For Docker setup: Docker and just task runner

Installation

Standalone

Show standalone instructions

  1. cd apps/api && composer install && cd ../web && bun install && cd ../..
  2. cp apps/api/.env.example apps/api/.env
  3. cd apps/api && php artisan key:generate && php artisan storage:link
  4. php artisan migrate && php artisan db:seed
  5. php artisan octane:install --server=swoole && php artisan octane:start --host=127.0.0.1 --port=8000
  6. In another terminal: cd apps/web && bun run dev

Docker

Single docker-compose.yml: API runs on Laravel Sail with Octane in watch mode, web runs on oven/bun:1, plus a redis:8-alpine service for cache / queue / session / throttling. Orchestrated via just. just sail ... wraps the upstream vendor/bin/sail for those who want it.

Installing just

bash
brew install just                          # macOS
apt install just                           # Debian / Ubuntu
winget install --id Casey.Just --exact     # Windows

Other systems: see the full list of packages.

Lifecycle

bash
just up -d                 # start full app (api + web) — :8000 / :3000
just prod -d               # production mode (Octane no-watch, web .output/)
just api -d                # api only — :8000
just web                   # web foreground, ephemeral — :3000
just stop                  # pause containers
just down                  # remove containers

Quick start:

bash
just init                  # copies .env files, composer install, builds api image, bun install, key:generate, storage:link
just up -d
just a migrate --seed

Common commands:

bash
just                       # show all recipes
just build                 # rebuild the api image
just a migrate             # `php artisan migrate` in ephemeral container
just sail ...              # invoke Laravel Sail directly (e.g. `just sail tinker`)
just composer require ...
just bun add @vueuse/core
just pint                  # PHP linter
just test                  # Pest
just down -v               # stop and remove volumes

Usage

Fetch wrapper

To integrate with the API, enhanced $http and useHttp wrappers are used, expanding the functionality of Nuxt's standard $fetch and useFetch. The $http wrapper includes custom interceptors to replace the originals:

  • onFetch instead of onRequest
  • onFetchError instead of onRequestError
  • onFetchResponse instead of onResponse
  • onFetchResponseError instead of onResponseError

Additionally, $http predefines a base url, authorization headers, and proxy IP for convenient API work in SSR mode. For example, the code for authorizing a user by email and password:

xml

  
    
      
    

    
      
    

    
      
    

    

  

In this example, a POST request will be made to the url "/api/v1/login"

Authentication

useAuthStore() has everything you need to work with authorization.

Data returned by useAuthStore:

  • logged: Boolean, whether the user is authorized
  • user: User object, user stored in pinia store
  • fetchCsrf: Function, fetch csrf token
  • fetchUser: Function, fetch user data
  • login: Function, login user
  • logout: Function, remove local data and call API to remove session
  • hasRole: Function, checks the role

Nuxt Middleware

The following middleware is supported:

  • guest: unauthorized users
  • auth: authorized users
  • verified: users who have confirmed their email
  • role-user: users with the 'user' role
  • role-admin: users with the 'admin' role

Laravel Middleware

All built-in middleware from Laravel + middleware based on roles Spatie Laravel Permissions Middleware

Examples

Route list

Demo

https://github.com/k2so-dev/laravel-nuxt/assets/15279423/9b134491-1444-4323-a7a3-d87833dcdc67

Links

  • Nuxt 4
  • Nuxt UI 4
  • Tailwind CSS 4
  • Laravel 13x

License

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHPboilerplatebreezejetstreamlaravel

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架