Download the PHP package protechstudio/oplogger without Composer

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

Oplogger

It offers a convenient and fast way to create a user operation log for any Laravel 5 application. It supports parameters and writes log to database by default but can also be used with a custom repository.

Installation

Require this package with composer using the following command:

After updating composer, add the service provider to the providers array in config/app.php

You may also add the Facade in the aliases array in config/app.php

Finally publish the configuration and migration files using the artisan command

You may also publish only the configuration file or the migration using the associated config and migrations tags

Run the migration ( only needed if you intend to use the internal repository )

Configuration

Open the published configuration file at config/oplogger.php:

Then populate the types array with all operation types with their specific message. If you intend to use a custom repository you must edit the repository element.

Using a custom repository

The custom repository must implement the LogRepositoryContract as in the example below:

Usage

You may use the Oplogger service in two ways:

Using the dependency or method injection

Using the Facade

Adding parameters to the operation string

The write method uses the vsprintf function internally so you may easily add any parameter you need to the type operation string in the config/oplogger.php

Then you can pass an array of parameters as the second argument of the write method

For advance use of parameters please check the vsprintf documentation.

Operation associated user

Oplogger automatically retrieves the logged in user using the Laravel Auth system. If you prefer you may also force to log the operation with a specific user passing the user id as the third argument

The internal repository

If you are using the internal repository, running the published migration will create a logs table with user_id, operation and laravel timestamp fields. Please note that if you are not using the laravel default users table for users you should edit the migration accordingly or an exception will be thrown due to the user_id foreign key constraint.

You may access the underlying Log model adding use Protechstudio\Oplogger\Models\Log; to the use statements.

Exceptions

Typing a wrong operation type key

If the operation key you type in the write method is not present in your configuration types array an OploggerKeyNotFoundException exception will be thrown.

Not providing a user for the operation

If you don't provide a specific user for the operation and the user is not logged in an OploggerUserNotLoggedException exception will be thrown.


All versions of oplogger with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
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 protechstudio/oplogger contains the following files

Loading the files please wait ....