oxygencms/oxy-nova
Composer 安装命令:
composer require oxygencms/oxy-nova
包简介
Set of tools and boilerplate to use with Laravel Nova.
README 文档
README
Installation
Require "oxygencms/oxy-nova": "@dev" in your own composer.json to get the package.
composer require oxygencms/oxy-nova
Since this package requires spatie/laravel-medialibrary to deal with uploads and media make sure you have it's migration published and run.
php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="migrations"
By default file conversions will be queued. It is recommended to set the QUEUE_CONNECTION=redis in your .env file.
If you do so also make sure to create the failed_jobs table. Then just run the queue worker as usual.
php artisan queue:failed-table
Config
Publish the oxygen.php config file.
php artisan vendor:publish --provider='Oxygencms\OxyNova\ServiceProvider' --tag=config
Define the 'media' disk for the media library in the config/filesystem.php file.
'media_disk' => [
'driver' => 'local',
'root' => storage_path('app/public/media'),
'url' => env('APP_URL').'/media',
'visibility' => 'public',
]
Publish the config for the media library it self.
php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag=config
In config/medialibrary.php set the default disk_name and optionally the image_driver
'disk_name' => 'media',
'image_driver' => 'imagick'
Translation Files
Use the translations tag to publish the language files for each locale in the config. (BG & NL available atm).
php artisan vendor:publish --provider='Oxygencms\OxyNova\ServiceProvider' --tag=translations
Views
The views can be published with the views tag.
php artisan vendor:publish --provider='Oxygencms\OxyNova\ServiceProvider' --tag=views
Migrations, Seeds and Factories
To publish the factories for this package you can use the factories tag:
php artisan vendor:publish --provider='Oxygencms\OxyNova\ServiceProvider' --tag=factories
To publish the migrations for this package you can use the migrations tag:
php artisan vendor:publish --provider='Oxygencms\OxyNova\ServiceProvider' --tag=migrations
To publish the seeders for this package you can use the seeds tag:
php artisan vendor:publish --provider='Oxygencms\OxyNova\ServiceProvider' --tag=seeds
To publish all of the above at once you can use the database tag:
php artisan vendor:publish --provider='Oxygencms\OxyNova\ServiceProvider' --tag=database
To include some dummy data for the packages entities add the SEED_TEST_DATA=true to the
.env file and seed your database with php artisan migrate:fresh --seed command.
Console
There is an artisan command for quick setup using the default config.
php artisan oxy-nova:setup
Tests
To run the tests include a <testsuite> tag in your project's phpunit.php file and point it to the tests dir.
<testsuite name="OxyNova">
<directory suffix="Test.php">./vendor/oxygencms/oxy-nova/tests</directory>
</testsuite>
Functionality
Phrases
The phrases are neat way to store translations in the database so they can be edited. To utilize them we need to swap
the default TranslationServiceProvider with the PhraseServiceProvider in config/app.php.
// Illuminate\Translation\TranslationServiceProvider::class,
Oxygencms\OxyNova\Providers\PhraseServiceProvider::class,
The phrase's caching requires cache driver that does support tagging! predis/predis is already required in the
package's composer file so we also need to configure laravel to use it. Set it in the .env file.
CACHE_DRIVER=redis
Then phrases and translations are both accessed with the standard Laravel helpers @lang(), __(), trans() &
trans_choice(). If a phrase exists in the database with the given group/key it will be returned and cached. If not
the one from the translation files will be returned instead. If both are present the one from DB will take precedence.
Pages
Using pages allows for easier management of the applications content and SEO. If a page has different slug for a given
locale, visiting that slug will change the application locale. While on a page changing the application locale by
hitting the setLocale route will redirect to the the slug of the page in the selected locale. Pages can have many
sections via the $page->sections(): HasMany relationship. On $page->delete() all sections that belong to the page
will be soft deleted and on $page->resotre() they will be restored automatically.
Page Sections
Page sections provide a simple way for adding additional content to a page. The owning page can be accessed via the
$pageSection->page(): BelongsTo relationship. When updating a page section if APP_ENV=production the name will no
longer be editable field because it may be in use in a view or controller to access a given section for a page.
oxygencms/oxy-nova 适用场景与选型建议
oxygencms/oxy-nova 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 286 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 11 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cms」 「nova」 「laravel」 「Oxygen」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 oxygencms/oxy-nova 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 oxygencms/oxy-nova 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 oxygencms/oxy-nova 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova card that shows you your system information.
A Laravel Nova card.
GraphQL authentication for your headless Craft CMS applications.
Set Links with a specific language parameter
A Laravel Nova package for publishable fields
A Laravel Nova package for translatable fields
统计信息
- 总下载量: 286
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-11-03