kiendaotac/filament-blog

丝胶博客构建器

0.1.6 2022-08-21 21:37 UTC

This package is auto-updated.

Last update: 2024-09-30 01:38:11 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

一个无脸的博客内容管理器,支持可配置的富文本和 Markdown,适用于丝胶管理面板。

丝胶管理面板

本包专为 丝胶管理面板 设计。

在继续安装之前,请确保您已安装了管理面板。您可以在此处查看文档

支持的版本

PHP: 8.0

Laravel: 8 & 9

安装

您可以通过 composer 安装此包

composer require stephenjude/filament-blog

php artisan filament-blog:install

php artisan storage:link

php artisan migrate

显示您的内容

丝胶博客构建器是无脸的,它对您在前端显示内容的方式没有意见。您可以使用控制器中的博客模型来显示不同的资源

  • Stephenjude\FilamentBlog\Models\Post
  • Stephenjude\FilamentBlog\Models\Author
  • Stephenjude\FilamentBlog\Models\Category

帖子 & 草稿

$posts = Post::published()->get();

$drafts = Post::draft()->get();

帖子内容

$post = Post::find($id);

$post->id;
$post->title;
$post->slug;
$post->excerpt;
$post->banner_url;
$post->content;
$post->published_at;

帖子分类 & 作者

$post = Post::with(['author', 'category'])->find($id);

$author = $post->author;

$author->id;
$author->name;
$author->email;
$author->photo;
$author->bio;
$author->github_handle;
$author->twitter_handle;


$category = $post->category;

$category->id;
$category->name;
$category->slug;
$category->description;
$category->is_visible;
$category->seo_title;
$category->seo_description;

配置

这是发布配置文件的内容

<?php

return [

    /**
     * Supported content editors: richtext & markdown:
     *      \Filament\Forms\Components\RichEditor::class
     *      \Filament\Forms\Components\MarkdownEditor::class
     */
    'editor'  => \Filament\Forms\Components\RichEditor::class,

    /**
     * Buttons for text editor toolbar.
     */
    'toolbar_buttons' => [
        'attachFiles',
        'blockquote',
        'bold',
        'bulletList',
        'codeBlock',
        'h2',
        'h3',
        'italic',
        'link',
        'orderedList',
        'redo',
        'strike',
        'undo',
    ],
];

更多截图

测试

composer test

变更日志

有关最近更改的更多信息,请参阅CHANGELOG

贡献

有关详细信息,请参阅CONTRIBUTING

安全漏洞

请审查我们的安全策略以了解如何报告安全漏洞。

鸣谢

许可证

MIT 许可证 (MIT)。有关更多信息,请参阅许可证文件