akki-io/laravel-nova-assets
Composer 安装命令:
composer require akki-io/laravel-nova-assets
包简介
A simple package for laravel nova to manage all nova related assets.
README 文档
README
Laravel Nova Search
This package provides a console command to convert dynamic JS/CSS to static JS/CSS assets.
Requirements
- laravel-mix v6.0+
- php 7.3+
- laravel nova 3.0+
Installation
You can install the package via composer:
composer require akki-io/laravel-nova-assets
Publish the package files:
php artisan vendor:publish --provider 'AkkiIo\LaravelNovaAssets\LaravelNovaAssetsServiceProvider'
This will publish the
- config file
config/laravel-nova-assets.phpand - the webpack file
webpack.mix.nova.js.
Usage
To create static assets the package provides a simple console command that will do the job for you.
Run
php artisan nova:mix
Once the command is executed you will need to update the laravel nova auth layout auth->layout.blade.php and main layout layout.blade.php to use the compiled assets.
- Copy the auth layout
vendor/laravel/nova/resources/views/auth/layout.blade.phptoresources/views/vendor/nova/auth/layout.blade.php - Copy the main layout
vendor/laravel/nova/resources/views/layout.blade.phptoresources/views/vendor/nova/layout.blade.php
Add manifest files above the </head> tag for both files.
<link rel="manifest" href="/vendor/laravel-nova-assets/mix-manifest.json">
Replace these following section in the newly copied files.
Original Content
// Tool Styles @foreach(\Laravel\Nova\Nova::availableStyles(.... .... @endforeach
New Content
<link rel="stylesheet" href="{{ mix('tool-styles.css', 'vendor/laravel-nova-assets') }}">
Original Content
<!-- Theme Styles --> @foreach(\Laravel\Nova\Nova::themeStyles() ...) .... @endforeach
New Content
<link rel="stylesheet" href="{{ mix('theme-styles.css', 'vendor/laravel-nova-assets') }}">
Original Content
<!-- Tool Scripts --> @foreach (\Laravel\Nova\Nova::availableScripts(request()) ...) ..... @endforeach
New Content
<script src="{{ mix('tool-scripts.js', 'vendor/laravel-nova-assets') }}"></script>
If you are using custom scripts and styles, add the following sections to these files accordingly.
<link rel="stylesheet" href="{{ mix('custom-styles.css', 'vendor/laravel-nova-assets') }}">
<script src="{{ mix('custom-scripts.js', 'vendor/laravel-nova-assets') }}"></script>
For copyright reason I cannot include those files in this project.
Adding custom CSS and JSS
You can specify you custom CSS/JS in the config file laravel-nova-assets.php under the styles and scripts section.
Running the command on a CI/CD
You will need to create a dummy user if you are using this command to generate assets. Unfortunately, I was not able to find a work around for this.
Using CDN
There are few packages that already provides this feature, some of these are
arubacao/asset-cdn- https://github.com/arubacao/asset-cdnpubliux/laravelcdn- https://github.com/publiux/laravelcdn
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email hello@akki.io instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
akki-io/laravel-nova-assets 适用场景与选型建议
akki-io/laravel-nova-assets 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18 次下载、GitHub Stars 达 3, 最近一次更新时间为 2021 年 12 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel-nova」 「akki-io」 「laravel-nova-assets」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 akki-io/laravel-nova-assets 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 akki-io/laravel-nova-assets 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 akki-io/laravel-nova-assets 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A package that extends search for laravel nova
A Laravel package to retrieve data from Google Analytics 4 using the GA4 Query Explorer
Laravel Nova resource and fields for single record resources
Laravel Nova package providing global floating scroll-to-top and scroll-to-bottom buttons for faster navigation.
A Laravel Nova tool for creating responsive tables.
A Laravel package to retrieve data from Google Analytics 4 using the GA4 Query Explorer
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-12-25
