klongchu/laravel-nuxt
Composer 安装命令:
composer require klongchu/laravel-nuxt
包简介
NuxtJS framework integration for Laravel
README 文档
README
This package facilitates integrating an SPA built with NuxtJS into an existing Laravel project.
Installation
composer require m2s/laravel-nuxt
After installation you can publish the config.
php artisan vendor:publish --provider="M2S\LaravelNuxt\LaravelNuxtServiceProvider"
Setup
The package provides a command for easy installation and integration of a nuxt project.
$ php artisan nuxt:install -h Description: Create a new nuxt project or setup integration of an existing one Usage: nuxt:install [options] [--] [<source>] Arguments: source Root folder of the nuxt application [default: "resources/nuxt"] Options: -y, --yarn Use yarn package manager -t, --typescript Use typescript runtime -c, --cache[=CACHE] Optional caching endpoint (e.g. /api/cache) -p, --prefix[=PREFIX] Prefix for the nuxt application (will use value from `config('nuxt.prefix')` if omitted) --no-export Do not export env variable on build -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question --env[=ENV] The environment the command should run under -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Automatic routing
By default the package automatically adds a route for nuxt pages.
Nuxt::route('/{path?}')->where('path', '.*')->name('nuxt');
This route is named 'nuxt' and can be used with Laravels route helper.
route('nuxt'); // or route('nuxt', ['path' => 'some/deep/path']);
You can disable/enable automatic routing with the 'routing' setting in config/nuxt.php.
Manual Routing
The package provides a simple facade which might be used to register nuxt routes.
Routes will automatically be prefixed with the configured path and a controller will be attached which handles internal redirection to nuxt.
The method returns a Illuminate\Routing\Route instance and may be used as normal.
In routes/web.php:
use M2S\LaravelNuxt\Facades\Nuxt; Nuxt::route('example/route')->name('nuxt.example');
klongchu/laravel-nuxt 适用场景与选型建议
klongchu/laravel-nuxt 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 09 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「typescript」 「SPA」 「pwa」 「nuxt」 「nuxtjs」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 klongchu/laravel-nuxt 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 klongchu/laravel-nuxt 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 klongchu/laravel-nuxt 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Generate typescript rpc from php
A Laravel-Nuxt starter project template.
Transforms Laravel Models to Typescript Interfaces/Types
Appui DOM Interface
Minimal Laravel authentication scaffolding with Vue, Vite, Typescript and Tailwind.
End-to-end type-safe APIs for Laravel. Like tRPC, but for Laravel + TypeScript.
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-24