Download the PHP package igaster/laravel-model-events without Composer

On this page you can find all versions of the php package igaster/laravel-model-events. 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-model-events

Description

Laravel License Downloads Build Status Codecov

This is as simple as keeping a diary for your models!

You can record a short message for any model with current timestamp and authenticated user.

Installation:

A) Execute composer require igaster/laravel-model-events

This package includes a Service Provider that will be automatically discovered by Laravel.

B) Run migrations.

This will create a table log_model_events that will be used to store events.

Usage:

Step 1: Add a Trait to your model:

Step 2: Log yout events:

a) Manually

Use the logModelEvent("Description") method to log any event

b) Automatically capture laravel model events:

Eloquent models fire several events during updating, creating etc. These events can be automatically logged. Just define these events inside the $logModelEvents static array in your model:

Step 3: Fetch a list of events:

a) From a $model instance:

b) From a $user instance:

In order to query events from a $user model you must first include this trait with the User class: Note: This trait is optional for the rest functions of this package!

c) Build your own queries:

All relationships with the LogModelEvent model have been implemented. These are some valid queries:

Step 4: Display Events:

a) Manually

Through a LogModelEvents model you can retrieve the $user and the $model instances:

Note the the $modelEvent->model is a polymorphic relationship and it will retrieve a $model instance on its respective class.

b) Use package sample view:

image

You may include the model-events::modelEvents partial in your views to render a list of events:

Available parameters are: model, user, count_events. All are optional


All versions of laravel-model-events with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
illuminate/contracts Version >= 5.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 igaster/laravel-model-events contains the following files

Loading the files please wait ....