定制 creode/nova-publishable 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

creode/nova-publishable

最新稳定版本:1.2.0

Composer 安装命令:

composer require creode/nova-publishable

包简介

Utilises the Publishable Package, to create a new published field for the module.

README 文档

README

Latest Version on Packagist Total Downloads

This package provides an integration between the Laravel Publishable package and Nova.

Installation

composer require creode/nova-publishable

Usage

To use the field, you must first add the Publishable trait to your model.

use PawelMysior\Publishable\Publishable;

class Post extends Model
{
    use Publishable;
}

Then, you can add the field to your Nova resource.

use Creode\LaravelPublishable\Published;

class Post extends Resource
{
    // ...

    public function fields(Request $request)
    {
        return [
            // ...

            Published::make('Published', 'published_at'),
        ];
    }
}

Publish/Unpublish Actions

This package also provides actions to publish and unpublish resources. To use these, you must add the Publishable trait to your model as above.

Then you can add the following actions to your Nova resource.

use Creode\NovaPublishable\Actions\PublishAction;
use Creode\NovaPublishable\Actions\UnpublishAction;

class Post extends Resource
{
    // ...

    public function actions(Request $request)
    {
        return [
            // ...

            new PublishAction,
            new UnpublishAction,
        ];
    }
}

Roadmap

  • Add tests with Dusk
  • Improve the field by allowing the user to schedule resources by specify a publishable date via a secondary field

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 350
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 6
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-29