marshmallow/blogs
Composer 安装命令:
composer require marshmallow/blogs
包简介
This packages add the resources you need to create a simple blog in Nova. This is fully extendable.
README 文档
README
Laravel Nova Blogs
This packages add the resources you need to create a simple blog in Nova. This is fully extendable.
Requirements
- PHP
^8.3 - Laravel Nova
^5.0
Installation
Composer
You can install the package via composer:
composer require marshmallow/blogs
Run the install command
The package ships an install command that publishes the config file, runs the
migrations (creating the blogs and blog_tags tables), generates the Blog
and BlogTag Nova resources, and registers the blog detail and tag routes:
php artisan blogs:install
Make sure the routes work
Create a page in your Nova Pages Resource. This page should have the route name blog-detail-page.
Create a page in your Nova Pages Resource. This page should have the route name blog-tag-page.
Configuration
The config file is published to config/blogs.php. Every value can be
overridden to swap in your own models, Nova resources and route names.
| Key | Default | Description |
|---|---|---|
publish_date_format |
d M |
Date format used by Blog::dateFormatted(). |
model.blog |
Marshmallow\Blogs\Models\Blog |
Blog Eloquent model. |
model.blog_tags |
Marshmallow\Blogs\Models\BlogTag |
Blog tag Eloquent model. |
model.user |
App\Models\User |
User model a blog belongs to. |
nova.blog_tags |
Marshmallow\Blogs\Nova\BlogTag |
Nova resource for blog tags. |
nova.user |
App\Nova\User |
Nova resource for the related user. |
images.image |
[1920, 800] |
Dimensions for the main image. |
images.overview_image |
[500, 280] |
Dimensions for the overview image. |
images.detail_image |
[900, 450] |
Dimensions for the detail image. |
routes.blog |
blog-detail |
Route name resolved by Blog::route(). |
routes.blog_tags |
blog-tag |
Route name for a tag overview. |
page_route_names.blog |
blog-detail-page |
Nova page route name for blog details. |
page_route_names.blog_tags |
blog-tag-page |
Nova page route name for tag pages. |
Usage
Blogs are managed through the generated Nova resources. On the frontend you work
with the Marshmallow\Blogs\Models\Blog model, which exposes a number of query
scopes and helper methods:
use Marshmallow\Blogs\Models\Blog; // Published blogs, newest first. $blogs = Blog::published()->ordered()->get(); // Apply the ?q= search filter from the current request. $results = Blog::published()->filtered()->ordered()->get(); // Blogs for a single tag. $tagged = Blog::tagged($tag)->get(); foreach ($blogs as $blog) { $blog->route(); // URL to the blog detail page $blog->dateFormatted(); // publish_date in config('blogs.publish_date_format') $blog->getImage(); // asset URL, defaults to the overview_image column $blog->tag; // related BlogTag $blog->user; // related user }
The Blog model also implements Marshmallow's Seoable and sitemap traits, so
published blogs are automatically included in the generated sitemap.
Changelog
Please see CHANGELOG for more information what has changed recently.
Security
If you discover any security related issues, please email stef@marshmallow.dev instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
marshmallow/blogs 适用场景与选型建议
marshmallow/blogs 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.02k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 04 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel blog」 「marshmallow」 「nova blog」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 marshmallow/blogs 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 marshmallow/blogs 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 marshmallow/blogs 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This packages provides you with the ability to easily connect your Laravel application to ZohoDesk.
Generate slugs when saving Eloquent models
A Laravel Nova help field.
Laravel package for opinionated blog implementation
Connect your Kiyoh to your Laravel application
Sending request to you Google Analytics has never been easier. With support for e-commerce tracking.
统计信息
- 总下载量: 3.02k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-04-26