Download the PHP package allenkhoury/user-activity without Composer

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

Laravel user activity and tracking

This package provides real-time tracking of active users on your website and logs their activity. It can be installed on any Laravel project version 9 or 10.

The real-time tracking is powered by websockets, so you will need to set up a Pusher account. Alternatively, laravel-websocket can also be used.


Requirement


Installing

Install this package through composer:

Once installed, it will be auto discovered by laravel.

Next, we need to publish the necessary data for this package: migrations, config and assets.

Run the code below to publish all package necessary data:

We can then run migrate to create the package's tables in the database.


Real time tracking

This package provides real-time tracking of active users on your website using websockets. Pusher is the preferred websockets provider for this package.

Installing Pusher

To install Pusher, you can follow the instructions in the Laravel broadcasting documentation.

Adding the tracking script to your layout file

Once you have installed Pusher, you need to add the following code to your layout blade file, at the bottom of the file after scripts:

This custom blade directive will inject some scripts in your layout file so Laravel Echo can start tracking properly.

Enabling real-time tracking

Finally, you need to enable real-time tracking by setting the following environment variable:

Setting the user identifier

The package needs to know which column in your database contains the user's name. By default, the package assumes that the column is called name. However, you can change this by setting the user_identifier option in the package configuration file.


Activity log

This package can also log user activity on the website. This can be useful for tracking how users are interacting with your website and identifying potential problems.

Enabling activity logging

To enable activity logging, you need to set the following environment variable to true:

Configuration

By default, this package will track the following HTTP requests:

However, you can change this configuration by editing the allowed_methods option in the package's published configuration file. For example, to only track POST and PUT requests, you would change the configuration to the following:

You can check the supported HTTP methods in the Laravel route documentation

Exceptions

You can exclude some routes from being tracked by adding the no-logging middleware to your routes.

Note: This package will only log activity of authenticated users. Guests will not be tracked.


Dashboard

The package comes with a dashboard that allows you to track active users and check all activity logs.

Enabling the dashboard

The dashboard is enabled by default. To disable it, set the following environment variable to false:

Dashboard URL

The dashboard is available on the URL /al-user-activity. You can change the URL by adding a prefix using the option url_prefix in the package configuration file. For example, to add the prefix admin (/admin/al-user-activity), you would change url_prefix as follows:

Dashboard access

By default, any authenticated user can access the dashboard. To restrict access, for example to just admins, you can add your custom middleware alias to the option extra_middlewares in the package configuration file. For example:

Note: You can add as many middlewares as needed.


General notes

The package will use the model set in config('auth.provider.users.model') as the users model.

The dashboard UI is built using the free template Sneat by ThemeSelection


License

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


All versions of user-activity with dependencies

PHP Build Version
Package Version
Requires yajra/laravel-datatables-oracle Version ^10.3.1
pusher/pusher-php-server Version *
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 allenkhoury/user-activity contains the following files

Loading the files please wait ....