ycs77 / inertia-engage
具有观点的 Inertia.js Laravel & Vue 辅助库,用于构建和扩展您的 Inertia.js 应用程序。
v1.5.0
2024-08-15 14:41 UTC
Requires
- php: >=8.2
- ergebnis/json-printer: ^3.5
- inertiajs/inertia-laravel: >=1.0
- laravel/framework: >=11.0
- laravel/prompts: ^0.1
- symfony/console: >=7.0
Requires (Dev)
- laravel/pint: ^1.13
- orchestra/testbench: >=9.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-laravel: ^2.4
README
具有观点的 Inertia.js Laravel & Vue 辅助库,用于构建和扩展您的 Inertia.js 应用程序。
功能
支持版本
安装
通过 composer 安装包
composer require ycs77/inertia-engage
发布配置文件是可选的
php artisan vendor:publish --tag=inertia-engage-config
然后安装 Inertia.js 框架到该应用程序
php artisan inertia:install
# or export with TypeScript
php artisan inertia:install --ts
或者直接初始化 Laravel 项目
php artisan laravel:initial
错误处理程序
如果您运行了
inertia:install
命令,以下内容将自动添加。
发布错误页面
php artisan inertia:ui error
# export with TypeScript
php artisan inertia:ui error --ts
然后扩展 Inertia 应用的异常处理程序
bootstrap/providers.php.php
<?php use Illuminate\Foundation\Configuration\Exceptions; use Illuminate\Http\Request; use Inertia\Inertia; use Symfony\Component\HttpFoundation\Response; ->withExceptions(function (Exceptions $exceptions) { $exceptions->respond(function (Response $response, Throwable $e, Request $request) { return Inertia::exception()->handle($request, $response, $e); }); })
分页
发布分页组件和 CSS 文件
php artisan inertia:ui pagination
# or export with TypeScript
php artisan inertia:ui pagination --ts
IDE 辅助工具
如果在 Inertia Laravel 包中缺少 IDE 辅助文件,您可以发布 IDE 辅助文件
php artisan inertia:ide-helper
许可证
MIT 许可证 (MIT)。请参阅许可证文件获取更多信息。