Download the PHP package yungts97/laravel-user-activity-log without Composer

On this page you can find all versions of the php package yungts97/laravel-user-activity-log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-user-activity-log

Laravel User Activity Log

yungts97/laravel-user-activity-log is a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app. It provides automatic logging for the model events without complicated action. All activity will be stored in the logs table.

📦 Environment Requirements

PHP: ^8.0

Laravel: ^8.x - ^9.0

🚀 Installation

You can install the package via composer:

The package will automatically register a service provider.

After that, we still need one more step to complete the installation by run this command.

✨ How to use?

This package is very simple and easy to use. The only thing you need to do is add the Loggable trait in your model class.

It might troublesome if you have a lot of models. You could have a base class for your models and add Loggable trait in your base model.

If you don't want to log for any child class of the base model, you can add SkipLogging trait to skip the log for the model.

Sometimes, you don't want to save certain attributes of your model in logging. You can add $log_hidden attribute to your model.

You can retrieve all activity using the Yungts97\LaravelUserActivityLog\Models\Log model.

However, you can get activity logs from a model by using this.

You allowed to specify the mode for the edit event log. There are two modes available now simple/full. The default mode is full.

⚙️ Configuration

You can change the configuration of this package on config/user-activity-log.php.

🐣 API Routes

Endpoint Method Response Format Description
/logs GET JSON To retrieve user activity logs.
/logs/filter-options GET JSON To retrieve filter options for filtering logs.
/logs/{log_id} GET JSON To retrieve specific activity log.
Available paramaters for log filtering: Parameter Type Description
page integer The page number for log pagination.
itemsPerPage integer The number item per page for log pagination
userId integer Filtering logs by the user ID.
dataId integer Filtering logs by the data ID.
logType string Filtering logs by log type.
tableName string Filtering logs by the table name.
dateFrom string Filtering logs by the date range. (Must have dateFrom & dateTo paramaters)
dateTo string Filtering logs by the date range. (Must have dateFrom & dateTo paramaters)

Exp. http://example.com/api/logs?page=1&itemsPerPage=10&userId=517

📬 Sample Response

/logs

/logs/filter-options

/logs/77

🎩 Artisan Commands

Command Description Option
user-activity-log:install Preparing all the files it needed for the user activity log package. N/A
user-activity-log:flush Remove all the user activity log records that in the database. N/A
user-activity-log:clean Remove the user activity log records that in the database. --day, --month, --year, --date

✒️ Options for user-activity-log:clean

Option Value Example Description
--day numeric --day=7 Delete user activity log older than N days.
--month mm/yyyy --month=01/2022 Delete user activity logs for a month of the year.
--year yyyy --year=2022 Delete user activity logs for a year.
--date yyyy --date=15/02/2022 Delete user activity logs for a specific date.

⚠️ Notice: Without any option applied by default is --day=7

📃 License

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


All versions of laravel-user-activity-log with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yungts97/laravel-user-activity-log contains the following files

Loading the files please wait ....