novius/laravel-nova-news
Composer 安装命令:
composer require novius/laravel-nova-news
包简介
A Laravel Nova package for news and blog posts management
README 文档
README
Laravel Nova News
Introduction
This Laravel Nova package allows you to manage Post news in your Laravel Nova admin panel.
You will be able to create posts, categories and tags.
You can attach multiple categories and tags to a post. Categories can be viewed as a listing page.
Requirements
- PHP >= 8.2
- Laravel Nova >= 4.0
- Laravel >= 10.0
NOTE: These instructions are for Laravel >= 10.0 and PHP >= 8.2 If you are using prior version, please see the previous version's docs.
Installation
You can install the package via composer:
composer require novius/laravel-nova-news
Register the tool in the tools method of the NovaServiceProvider:
// app/Providers/NovaServiceProvider.php public function tools() { return [ // ... new \Novius\LaravelNovaNews\LaravelNovaNews(), ]; }
Run migrations with:
php artisan migrate
Configuration
You can optionally publish the config file with:
php artisan vendor:publish --provider="Novius\LaravelNovaNews\LaravelNovaNewsServiceProvider" --tag="config"
This will allow you defined routes names and
This will allow you to:
- define the name of the routes and their parameter
- override resource or model class
- define locales used
// config/laravel-nova-news.php return [ // ... 'resources' => [ 'post' => \App\Nova\Post::class, ], ];
// app/Nova/Post.php namespace App\Nova; use Laravel\Nova\Fields\Text; class Post extends \Novius\LaravelNovaNews\Nova\NewsPost { public function mainFields(): array { return [ ...parent::mainFields(), Text::make('Subtitle'), ]; } }
Front Stuff
If you want a pre-generated front controller and routes, you can run following command :
php artisan news-manager:publish-front {--without-categories} {--without-tags}
This command appends routes to routes/web.php and creates a new App\Http\Controllers\FrontNewsController.
You can then customize your routes and your controller.
In views called by the controller use the documentation of laravel-meta to implement meta tags
Assets
Next we need to publish the Laravel Nova Translatable package's assets. We do this by running the following command:
php artisan vendor:publish --provider="Novius\LaravelNovaTranslatable\LaravelNovaTranslatableServiceProvider" --tag="public"
Migrations and lang files
If you want to customize the migrations or lang files, you can publish them with:
php artisan vendor:publish --provider="Novius\LaravelNovaNews\LaravelNovaNewsServiceProvider" --tag="migrations"
php artisan vendor:publish --provider="Novius\LaravelNovaNews\LaravelNovaNewsServiceProvider" --tag="lang"
Testing
Run the tests with:
composer test
Lint
Lint your code with Laravel Pint using:
composer lint
Licence
This package is under GNU Affero General Public License v3 or (at your option) any later version.
novius/laravel-nova-news 适用场景与选型建议
novius/laravel-nova-news 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.48k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2024 年 02 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「nova」 「news」 「laravel」 「articles」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 novius/laravel-nova-news 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 novius/laravel-nova-news 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 novius/laravel-nova-news 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova card that shows you your system information.
A Laravel Nova card.
A Laravel Nova package for publishable fields
A Laravel Nova package for translatable fields
A Laravel Nova Image field. you can paste or drag or chose an image
Extend news to use them also as event
统计信息
- 总下载量: 3.48k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: AGPL-3.0-or-later
- 更新时间: 2024-02-19