Download the PHP package jvizcaya/loggable without Composer

On this page you can find all versions of the php package jvizcaya/loggable. 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 loggable

Loggable (Provides functions to record user activities in the application models.)

Loggable is a package for Laravel 5.7+ that adds functionalities to record user activities on the tables in the application database, inspired by the haruncpi/laravel-user-activity package.

Loggable saves a record in the logs table each time a user performs an operation on each model that uses the Trait on the created, updated and deleted events.

Installation

We publish the config file if we want to change the table name in the database used by this package, as well as other options.

Run the migration to export the logs table in the database.

Use mode

Add the trait Jvizcaya\Loggable\Loggable to the model of the table we want the user activity logs to be saved.

That's all, in the previous example a record will be made in the logs table every time a user saves, updates or deletes in the Post model table.

Retrieve models logs

This package was built in using the Laravel one-to-many polymorphic relationship convention and the trait Jvizcaya\Loggable\Loggable has the model relationship definition.

Load post logs

Lazy Eager Loading

Scope lastLogs($limit = 10, $loadUser = true, $userColumns = 'id,name')

Optionally we can use the scope lastLogs to load the model last logs. This function accepts as the first parameter the maximum number of results.

By default this function loads the user data associated with each log. If we want to select the columns of the user table, we can pass a string with the names of the columns separated by a comma(,) as the third parameter.

To disable the loading of user data, pass a boolean false as the second parameter.

Log model data

By default, model data will be saved to the payload object's data attribute on delete operations. You can disable this functionality by setting the log_data variable in the configuration file to false.

Logs delete (console command)

To delete the activity log data, we can use the available console command loggable:delete, this command will delete the logs that are older than the days defined in the loggable.php configuration file (30 days by default).

Optionally, we can pass the value of the days as the command argument.

Add the console command loggable:delete to Task scheduling for run the command automatically.


Note

This package use the model file Jvizcaya\Loggable\Models\Log.

License

MIT © Jorge Vizcaya | [email protected]


All versions of loggable with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3|^8.0
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 jvizcaya/loggable contains the following files

Loading the files please wait ....