Skip to content

ajayjoshioutdosolutions/PolymorphicHistory

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logging Actions

Installation

You can install the package via composer:

composer require AjayJoshi/polymorphic-history

php artisan vendor:publish --provider="AjayJoshi\PolymorphicHistory\PolymorphicHistoryServiceProvider"

Usage

Use Trait in Model

use AjayJoshi\PolymorphicHistory\Traits\ModelHistoryTrait;


class Order extends Model
{
    use HasFactory;
   
    use ModelHistoryTrait;

Extend Actions

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)

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

PolymorphicHistory

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%