Download the PHP package klevze/online-users without Composer

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

Laravel plugin for displaying online users on a webpage

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

"Online Users" is a Laravel package designed to effortlessly track and display the real-time count of users currently active on your web application. With seamless integration, this package provides a quick and reliable solution for monitoring and presenting the dynamic online user presence, enhancing the overall user experience on your Laravel-powered website.

Installation

You can install the package via composer:

You can publish and run the migrations with:

Integration with Laravel's Kernel Middleware

To enable the "Online Users" middleware in your Laravel application, follow these steps:

  1. Open the app/Http/Kernel.php file in your Laravel project.

  2. Locate the $middlewareGroups property, specifically within the web middleware group.

  3. Add the following line to the web middleware group:

Cleanup Inactive Users Console Command

The "CleanupInactiveUsers" console command provided by the "Online Users" package allows you to remove inactive users from the user_activities table. Follow the steps below to integrate and schedule the cleanup task.

  1. Open the app/Console/Kernel.php file in your Laravel project.

  2. Locate the schedule method and add the following entry to schedule the cleanup:inactive-users command every five minutes:

  3. Save the changes to the Kernel.php file.

Now, the "CleanupInactiveUsers" console command will run every five minutes, cleaning up inactive users from the user_activities table.

Usage

Once package is installed, you can use the OnlineUsers class to get the number of active users. For example, the following code will get the number of active users:

Or you can use it directly in blade view:

Demo

You can see a working demo at these sites:

License

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


All versions of online-users with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
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 klevze/online-users contains the following files

Loading the files please wait ....