← All plugins
MoonShine Changelog
MoonShine Changelog - это пакет для MoonShine, который добавляет функционал отслеживания изменений в моделях, позволяя легко просматривать историю последних модификаций через специальный компонент в админ-панели.
MoonShine Changelog
Requirements
Installation
composer require moonshine/changelog
composer require moonshine/changelog
composer require moonshine/changelog
composer require moonshine/changelog
composer require moonshine/changelog
php artisan migrate
php artisan migrate
php artisan migrate
php artisan migrate
php artisan migrate
Get started
Add trait HasChangeLog to model
class Post extends Model
{
use HasChangeLog;
}
class Post extends Model
{
use HasChangeLog;
}
class Post extends Model
{
use HasChangeLog;
}
class Post extends Model
{
use HasChangeLog;
}
class Post extends Model
{
use HasChangeLog;
}
Add component to Page
protected function bottomLayer(): array
{
return [
...parent::bottomLayer(),
ChangeLog::make('Changelog', $this->getResource())
];
}
protected function bottomLayer(): array
{
return [
...parent::bottomLayer(),
ChangeLog::make('Changelog', $this->getResource())
];
}
protected function bottomLayer(): array
{
return [
...parent::bottomLayer(),
ChangeLog::make('Changelog', $this->getResource())
];
}
protected function bottomLayer(): array
{
return [
...parent::bottomLayer(),
ChangeLog::make('Changelog', $this->getResource())
];
}
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)
);
}
}
class PostResource extends ModelResource
{
// ...
protected function onBoot(): void
{
$this->getPages()
->formPage()
->pushToLayer(
Layer::BOTTOM,
ChangeLog::make('Changelog', $this)
);
}
// ...
}
class PostResource extends ModelResource
{
// ...
protected function onBoot(): void
{
$this->getPages()
->formPage()
->pushToLayer(
Layer::BOTTOM,
ChangeLog::make('Changelog', $this)
);
}
// ...
}
class PostResource extends ModelResource
{
// ...
protected function onBoot(): void
{
$this->getPages()
->formPage()
->pushToLayer(
Layer::BOTTOM,
ChangeLog::make('Changelog', $this)
);
}
// ...
}
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)
ChangeLog::make('Changelog', $this)->limit(10)
ChangeLog::make('Changelog', $this)->limit(10)
ChangeLog::make('Changelog', $this)->limit(10)
ChangeLog::make('Changelog', $this)->limit(10)