tripteki/laravelphp-log

Trip Teknologi's Laravel.php Log

1.0.0 2023-02-01 08:25 UTC

This package is auto-updated.

Last update: 2023-02-01 08:27:31 UTC


README

This package provides wrapper of an implementation Auth Activity Log in repository pattern for Lumen and Laravel.

Getting Started

Installation :

$ composer require tripteki/laravelphp-log

How to use it :

  • Put Tripteki\Log\Providers\LogServiceProvider to service provider configuration list.

  • Publish config file in the root of your project's directory with running :

php artisan vendor:publish --tag=tripteki-laravelphp-log
  • Put Tripteki\Log\Traits\LogCauseTrait to auth's provider model.

  • Put Tripteki\Log\Traits\LogTrait to any of your model's target and optionally you can configure protected static of $recordName, $recordEvents, and $recordLists.

  • Do activities to your models' target.

  • Migrate.

$ php artisan migrate
  • Sample :
use Tripteki\Log\Contracts\Repository\Admin\ILogRepository as ILogAdminRepository;
use Tripteki\Log\Contracts\Repository\ILogRepository;

$logAdminRepository = app(ILogAdminRepository::class);

// $logAdminRepository->get(1); //
// $logAdminRepository->all(); //

$repository = app(ILogRepository::class);
// $repository->setUser(...); //
// $repository->getUser(); //

// $repository->archive(1); //
// $repository->unarchive(1); //
// $repository->all(); //

Author