Download the PHP package cerutti-maicon/laravel-activitylog-for-tenancy-for-laravel without Composer

On this page you can find all versions of the php package cerutti-maicon/laravel-activitylog-for-tenancy-for-laravel. 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-activitylog-for-tenancy-for-laravel

Log activity inside your Laravel app

Latest Version on Packagist Total Downloads

This project is a fork of spatie/laravel-activitylog.

Now compatible with Laravel 10.

What we want with this fork is to make it possible for the logs not to be centralized in a single table. Over time, all system logs end up generating a table with many records, and to alleviate this problem, the proposal here is to use the package Tenancy for Laravel to create a second tenant , with the nomenclature having a _logs suffix. And so making each tenant have 2 databases.

To proceed with the implementations of Logs you should still use the documentation from Spetie Laravel-activitylog.

The changes in this package were that an attribute for the useLogName function must always be informed, as this attribute will define the name of the table to save the log data informed by the getActivitylogOptions function applied to the model.

Installation

You can install the package via composer:

The package will automatically register itself.

You can publish the migration with:

Yes, this command remains the same

Compulsorily, you can publish the configuration file with:

Note that there are some extra settings tenant_model and tenant_seeder_model. These settings are used to define the template that will be used to create the tenant and the template that will be used to create the tenant propagator. They must be met according to each project implementation.

Create the databases following the prefix pattern for the main tenants:

Example:

After publishing the migration, you can run the migrations with the following command:

The above command also generates the records of the tenants from logs in the tenants table of the application's central database.

Note that there is a run of a seeder that truncates the migrations table. Yes, this is done on purpose, so that the tables created in the tenant logs contain the same tables as the main tenant automatically, so the developer doesn't have to recreate other migrations for this function.

It is extremely important for this package to work that MultiActivity is listed in the project configuration, it is thanks to this that the connections are switched between the main tenant and the log tenant.

Commands

The package comes with some artisan commands to run the migrations and seeder only for the main tenants, the tenant logs should work automatically:

Migrate for Tenant Logs

It must be run for each new table created in the main tenant, in order to be able to generate the logs for it.

Migrate for Tenant Main

It should be executed when the objective is to run migrations only for the main tenants.

This command lists all tenants in the system

Has --tenants option to run for a specific tenant

Has --class and --tenants option to run for a specific tenant

Warning

It is extremely discouraged to continue to use the native commands from the Tenancy for Laravel package.

For example:

This command does not differentiate between the main tenant and the log tenant

Because it is not making any difference between main tenant and log tenant, it would be at your own risk to run migrations from different migration directories (some more basic validations were implemented to prevent these types of errors, but only if you use the native commands of this one package).

License

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


All versions of laravel-activitylog-for-tenancy-for-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/config Version ^8.0 || ^9.0 || ^10.0
illuminate/database Version ^8.69 || ^9.27 || ^10.0
illuminate/support Version ^8.0 || ^9.0 || ^10.0
spatie/laravel-package-tools Version ^1.6.3
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 cerutti-maicon/laravel-activitylog-for-tenancy-for-laravel contains the following files

Loading the files please wait ....