This packages add the resources you need to create a simple blog in Nova. This is fully extendable.
marshmallow/blogs is a Laravel package for this packages add the resources you need to create a simple blog in nova. this is fully extendable..
It currently has 0 GitHub stars and 3.019 downloads on Packagist (latest version 5.0.2).
Install it with composer require marshmallow/blogs.
Discover more Laravel packages by marshmallow
or browse all Laravel packages to compare alternatives.
Last updated

This packages add the resources you need to create a simple blog in Nova. This is fully extendable.
^8.3^5.0You can install the package via composer:
composer require marshmallow/blogs
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
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.
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. |
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.
Please see CHANGELOG for more information what has changed recently.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.