akiftezcan38/history-log

That allows you to keep a revision history for your models without thinking.

v1.0.9 2024-04-22 14:17 UTC

This package is auto-updated.

Last update: 2024-09-22 15:11:09 UTC


README

History Registry is a simple and useful package where you can keep your history. With the history log, you can track the arrivals in an order and see who made these changes. At the same time, you can temporarily restrict the settings to watch the history or decide which events (creation, update, deletion, etc.) will be written to the table.

Installation

composer require akiftezcan38/history-log
php artisan migrate

Usage

History Log is simple to use. When you call HistoryableTrait into your model classes whose history you want to monitor, History Log will start to keep history for your model.

    use HistoryableTrait;
  • If you want to exclude some columns from this, add this variable to your model class globally and write the column names as an array.
    protected $excludedColumns = ['deleted_at', 'id'];
  • If you don't want to keep history in some model events, add the following variable. Currently, this version only keeps the history of create, update and delete events. A save event will be added in the future.
    protected $excludedEvents = ['delete', 'create'];

Giriş

History Log veritabanı geçmişinizi tutabileceğiniz basit ve faydalı bir pakettir. History log ile bir sütunda meydana gelen değişikleri izleyebilirsiniz ve bu değişiklerin kim tarafından yapıldığını görebilirsiniz. Ayrıca opsiyonel olarak , geçmişini izleyeceğiniz sütunları kısıtlayabilir veya hangi eventlerde (create , update , delete vs.) tabloya yazacağına karar verebilirsiniz.

Kurulum

composer require akiftezcan38/history-log
php artisan migrate

Kullanım

History Log'un kullanımı basittir. Geçmişini izlemek istediğiniz model classlarınızın içine HistoryableTrait çağırdığınızda artık modeliniz için History Log geçmiş tutmaya başlayacak.

    use HistoryableTrait;
  • Eğer bazı sütunları bundan hariç tutmak istiyorsanız model classınızın içerisine global olarak bu değişkeni ekleyin ve array olarak sütun isimlerini yazın.
    protected $excludedColumns = ['deleted_at', 'id'];
  • Eğer bazı model eventlerinde geçmiş tutmak istemiyorsanız aşağıdaki değişkeni ekleyin. Şuan bu versyionda sadece create , update ve delete eventlerinin geçmişini tutuyor. İlerleyen zamanlarda save event da eklenecektir.
    protected $excludedEvents = ['delete', 'create'];