Download the PHP package muhammadaftabb/laravel-realtime-user-status without Composer

On this page you can find all versions of the php package muhammadaftabb/laravel-realtime-user-status. 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-realtime-user-status

Laravel Real-Time User Status

A Laravel package for tracking and displaying real-time user online status.

Installation

  1. Require the package via Composer:
    
    composer require muhammadaftabb/laravel-realtime-user-status
    Publish the package assets and configuration:

bash Copy code php artisan vendor:publish --provider="MuhammadAftab\RealTimeUserStatus\RealTimeUserStatusServiceProvider" --tag=realtime-user-status Run the migrations:

bash Copy code php artisan migrate Configure Pusher: Add your Pusher credentials to your .env file:

env Copy code PUSHER_APP_ID=your-pusher-app-id PUSHER_APP_KEY=your-pusher-app-key PUSHER_APP_SECRET=your-pusher-app-secret PUSHER_APP_CLUSTER=your-pusher-app-cluster Include the JavaScript file in your layout: Add the following script tag to your main layout file (e.g., resources/views/layouts/app.blade.php):

html Copy code

Add Middleware: Include the middleware in the web middleware group in app/Http/Kernel.php:

php Copy code protected $middlewareGroups = [ 'web' => [ // other middleware... \MuhammadAftab\RealTimeUserStatus\Http\Middleware\UpdateUserStatus::class, \MuhammadAftab\RealTimeUserStatus\Http\Middleware\LogUserActivity::class, ], ]; Usage Use the helper functions in your Blade views to display online users and their last activity.

Display Online Users blade Copy code

Online Users

@foreach(\MuhammadAftab\RealTimeUserStatus\Helpers\RealTimeUserStatusHelper::getOnlineUsers() as $user)

{{ $user->name }} - @if($user->is_online) {{ config('realtime-user-status.online_status.online') }} @else {{ str_replace(':time', $user->last_activity->diffForHumans(), config('realtime-user-status.online_status.offline')) }} @endif

@endforeach Display User Activity Log blade Copy code

User Activity Log

@foreach(\MuhammadAftab\RealTimeUserStatus\Helpers\RealTimeUserStatusHelper::getUserActivityLogs() as $log)

{{ $log->created_at->diffForHumans() }} - {{ $log->user->name }}: {{ $log->activity }}

@endforeach Configuration The package configuration file is located at config/realtime-user-status.php. You can customize the online and offline status messages there.

php Copy code return [ 'pusher' => [ 'app_id' => env('PUSHER_APP_ID'), 'app_key' => env('PUSHER_APP_KEY'), 'app_secret' => env('PUSHER_APP_SECRET'), 'app_cluster' => env('PUSHER_APP_CLUSTER'), ], 'online_status' => [ 'online' => 'Online', 'offline' => 'Last seen :time ago' ] ]; License This package is open-sourced software licensed under the MIT license.


All versions of laravel-realtime-user-status with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
pusher/pusher-php-server Version ^7.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 muhammadaftabb/laravel-realtime-user-status contains the following files

Loading the files please wait ....