ianrothmann/inertia-laravel-app-service
Composer 安装命令:
composer require ianrothmann/inertia-laravel-app-service
包简介
RocketFramework Inertia Laravel Helpers
README 文档
README
RocketFramework for Inertia and Laravel.
Installation
composer install ianrothmann/inertia-laravel-app-service
In config/app.php (if it does not auto-configure)
Service provider
IanRothmann\InertiaApp\ServiceProviders\InertiaAppServiceProvider::class
Facades
'Rocket' =>IanRothmann\InertiaApp\Facades\InertiaApp::class
Publish the config
php artisan vendor:publish --provider="IanRothmann\InertiaApp\ServiceProviders\InertiaAppServiceProvider" --tag="config"
Configuration
In the boot method of AppServiceProvider.php:
InertiaApp::register()->resolveMenuItemRightsWith(function($code){ //The code that is required to resolve a menu right return Auth::check() && Auth::user()->hasRight($code); });
Menus
Menus can be specified in middleware, but can also be modified in any controller before passing the view.
Usage
You can give the menu a name, for instance "main", and then chain the items. The icon is optional. If you need a custom item, you can use ->custom
$group=InertiaApp::menuGroup('Sub-menu','mdi-account') ->route('Page 1','pages.page1',[],'mdi-phone') ->link('Google','http://google.com','mdi-link'); InertiaApp::menu('main') ->route('Item 1','pages.spec',[1,2],'mdi-home') ->route('Item 2','pages.spec',[2,1],'mdi-phone','test') ->route('Item 3','pages.spec',[9,8],'mdi-phone') ->group($group) ->link('Google','http://google.com');
Prepending
Sometimes one would like to prepend items (especially when modifying middleware defined menus from the controller. All item functions can start with prepend to prepend.
$group=InertiaApp::menuGroup(Auth::user()->name,'mdi-account') ->route('Update profile','pages.user.profile',[],'mdi-account-card-details-outline') ->route('Change password','pages.user.changepassword',[],'mdi-key-variant'); InertiaApp::menu('main') ->prependGroup($group); //or prependRoute, prependCustom etc.
Helpers
For brevity, we registered iview() which is the same as Inertia::render().
You can also use page_title('Page title here',$addTobreadcrumbs=true) to set the page title and breadcrumbs.
Front-end
Docs coming soon
Breadcrumbs
Docs coming soon
ianrothmann/inertia-laravel-app-service 适用场景与选型建议
ianrothmann/inertia-laravel-app-service 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8.97k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2019 年 11 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 ianrothmann/inertia-laravel-app-service 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ianrothmann/inertia-laravel-app-service 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 8.97k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2019-11-04