moonshine/changelog
最新稳定版本:3.0.0
Composer 安装命令:
composer require moonshine/changelog
包简介
Model ChangeLog for MoonShine
关键字:
README 文档
README
Requirements
- MoonShine v4.0+
Support MoonShine versions
| MoonShine | ChangeLog |
|---|---|
| 2.0+ | 1.0+ |
| 3.0+ | 2.0+ |
| 4.0+ | 3.0+ |
Installation
composer require moonshine/changelog
php artisan migrate
Get started
Add trait HasChangeLog to model
class Post extends Model { use HasChangeLog; }
Add component to Page
protected function bottomLayer(): array { return [ ...parent::bottomLayer(), ChangeLog::make('Changelog', $this->getResource(), \App\MoonShine\Resources\MoonShineUserResource::class) ]; }
or in Resource
class PostResource extends ModelResource { // ... protected function onLoad(): void { $this->getFormPage()->pushToLayer( Layer::BOTTOM, ChangeLog::make('Changelog', $this, \App\MoonShine\Resources\MoonShineUserResource::class) ); } // ... }
By default, 5 last changes are displayed. To change this, use the limit() method
ChangeLog::make('Changelog', $this)->limit(10)
By default, Resource of BelongsTo is MoonShine\Laravel\Resources\MoonShineUserResource
To change this, use the userResource parameter
ChangeLog::make('Changelog', $this, userResource: \App\MoonShine\Resources\MoonShineUserResource::class)->limit(10)
统计信息
- 总下载量: 11.84k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2023-10-29