You can install the package via composer:
composer require AjayJoshi/polymorphic-history
php artisan vendor:publish --provider="AjayJoshi\PolymorphicHistory\PolymorphicHistoryServiceProvider"
use AjayJoshi\PolymorphicHistory\Traits\ModelHistoryTrait;
class Order extends Model
{
use HasFactory;
use ModelHistoryTrait;
use AjayJoshi\PolymorphicHistory\Enums\ModelHistoryEnum;
class HistoryActions extends ModelHistoryEnum {
const ORDER_CREATED = 100;
const ORDER_UPDATED = 101;
const ORDER_DELETED = 102;
//... So on
}
#use Faced or $model
\ModelAction::log($model,HistoryActions::PURCHASE_ORDER_EXTENDED,'test','remark');
#list morphmanyrelation objects
foreach($model->modelActivity as $acitivity)
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email ajayjoshi.mtr@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.