Download the PHP package mattyeend/logging without Composer

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

Logging Package

A Laravel package for logging application events into a database table. This package provides an extensible model, a database migration, and helper methods for recording user and system actions in a structured and searchable format.


Features


Installation

  1. Require the package Run the following command: composer require MattYeend/Logging

  2. Publish the log.php model Run php artisan vendor:publish --tag=logging-model

  3. Run Migrations Run the migrations to create the logs table: php artisan migrate

Usage

Log an Action

Use the Log model to log actions. The predefined constants simplify common actions

Log Custom Actions

You can log actions not predefined in the package: Log::log(99, ['custom_key' => 'custom_value'], auth()->id(), $relatedUserId);

Model Relationships

Retrieve the user who performed the action or the user related to it:

Predefined Actions

Constant Value Description
ACTION_LOGIN 1 User logged in
ACTION_LOGOUT 2 User logged out
ACTION_CREATE_USER 3 Created a new user
ACTION_UPDATE_USER 4 Updated a user
ACTION_DELETE_USER 5 Deleted a user
ACTION_SHOW_USER 6 Viewed a user profile
ACTION_WELCOME_EMAIL_SENT 7 Sent a welcome email
ACTION_CONFIRM_PASSWORD 8 Confirmed password
ACTION_FORGOT_PASSWORD 9 Initiated password reset
ACTION_REGISTER_USER 10 Registered a new user
ACTION_LOGIN_FAILED 11 Login failed
ACTION_LOGIN_PASSWORD_FAILED 12 Login via password failed
ACTION_LOGIN_EMAIL_FAILED 13 Login via email failed
ACTION_LOGIN_USERNAME_FAILED 14 Login via username failed
ACTION_LOGIN_SUCCESS 15 Login success
ACTION_RESET_PASSWORD 16 Reset password
ACTION_RESET_EMAIL 17 Reset email
ACTION_RESET_USERNAME 18 Reset username
ACTION_VERIFY_USER 19 Verified user email
ACTION_PASSWORD_CHANGED 20 Changed password
ACTION_MFA_ENABLED 21 Enabled multi-factor auth
ACTION_MFA_DISABLED 22 Disabled multi-factor auth
ACTION_PROFILE_UPDATED 23 Updated user profile
ACTION_EMAIL_UPDATED 24 Updated email address
ACTION_ROLE_ASSIGNED 25 Assigned a role to a user
ACTION_PERMISSION_GRANTED 26 Granted permissions to user
ACTION_PERMISSION_REVOKED 27 Revoked user permissions
ACTION_GENERAL_ERROR 28 General error
ACTION_FOUR_HUNDRED_ERROR 29 Four hundred error
ACTION_FIVE_HUNDRED_ERROR 30 Five hundred error
ACTION_CLEAR_CACHE 31 Clear Cache

Customisation

Extend the Logger Model

Add additional functionality by extending the Log model in your application.

Troubleshooting

  1. Migration Not Found Ensure the LoggerServiceProvider is loading migrations by verifying the path in: src/LoggerServiceProvider.php: $this->loadMigrationsFrom(__DIR__ . '/Database/Migrations');

  2. Data Validation Issues Ensure data passed to Log::log() is either null or an array. Example: Log::log(Log::ACTION_LOGIN, ['key' => 'value'], auth()->id());

Testing

To run tests, follow the next steps:

  1. Install dependencies:

  2. Run the tests:

License

This package is licensed under the MIT License.

Contributing

Feel free to fork the repository and submit pull requests for improvements or new features!


All versions of logging with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
illuminate/support Version ^10.0 || ^11.0 || ^12.0 || ^13.0
laravel/framework Version ^10.0 || ^11.0 || ^12.0 || ^13.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 mattyeend/logging contains the following files

Loading the files please wait ...