tripteki / laravelphp-log
Trip Teknologi's Laravel.php Log
1.0.0
2023-02-01 08:25 UTC
Requires
- php: ^8.0.2
- spatie/laravel-activitylog: ^4.7.2
- tripteki/laravelphp-repository: ^1.0.0
Suggests
- laravel/framework: Required when using laravel framework (^9.0).
- laravel/lumen-framework: Required when using lumen framework (^9.0).
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 configureprotected 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
- Spatie (@spatie)
- Trip Teknologi (@tripteki)
- Hasby Maulana (@hsbmaulana)