moonshine / changelog
Model ChangeLog for MoonShine
Installs: 1 806
Dependents: 1
Suggesters: 1
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: ^8.1|^8.2
- ext-curl: *
- ext-json: *
Requires (Dev)
- brianium/paratest: ^6.8
- mockery/mockery: ^1.4.4
- orchestra/testbench: ^4.0|^5.0|^6.0|^7.0|^8.0
- phpstan/phpstan: ^1.4.7
- phpunit/phpunit: ^9.5.8
Conflicts
- moonshine/moonshine: <2.0
This package is auto-updated.
Last update: 2024-05-02 13:12:43 UTC
README
Requirements
- MoonShine v2.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()) ]; }
or in Resource
class PostResource extends ModelResource { // ... protected function onBoot(): void { $this->getPages() ->formPage() ->pushToLayer( Layer::BOTTOM, ChangeLog::make('Changelog', $this) ); } // ... }
By default, 5 last changes are displayed. To change this, use the limit() method
ChangeLog::make('Changelog', $this)->limit(10)