Download the PHP package learncodeweb/activitylog without Composer

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

๐Ÿ—‚๏ธ Laravel Activity Log

Latest Version on Packagist Total Downloads License: MIT PHP Version

A simple and powerful Activity Log package for Laravel. It automatically tracks and records every user action in your admin or user panel after login โ€” no complex setup needed.

โœ… Tested with Laravel 8, 9, 10, 11, 12


โœจ Features


๐Ÿ“‹ Requirements

Requirement Version
PHP >= 7.0
Laravel >= 8.x
Guzzle HTTP ^7.0

๐Ÿš€ Installation

Install the package via Composer:

Register Service Provider

โš ๏ธ Important: This package does not support Laravel's auto-discovery. You must manually register the service provider based on your Laravel version.


Laravel 8, 9, 10 โ€” config/app.php

Open config/app.php and add inside the providers array:


Laravel 11 & 12 โ€” bootstrap/providers.php

Laravel 11 and 12 no longer use config/app.php for providers. Instead, open bootstrap/providers.php and add:


๐Ÿ—„๏ธ Database Setup

Step 1 โ€” Publish Migration

Step 2 โ€” Run Migration

This creates the activity_logs table in your database.


โš™๏ธ Configuration (Optional)

Export the config file to customize settings:

This creates config/lcw_activity_log_config.php. Below are the available options:


๐Ÿ“– Usage

View Logs (Default Built-in View)

The package automatically provides a log viewer at:

Route name: lcw_activity_log_index


Get Logs in Your Own Controller

You can fetch logs manually and display them in your own view:


Delete Old Logs

Delete logs older than a given number of months:


Create a Custom Log Entry

You can manually create a log entry with custom data:

Available Parameters for create()

Parameter Type Description
log string A description of the activity
server_ip string The server's IP address
user_ip string The client/user's IP address
route_detail array Array with current route path details
query_string array Array of request parameters
user_id int Authenticated user's ID
user array Array of authenticated user data
created_at datetime Custom timestamp for the log entry

๐Ÿ”’ Ignoring Routes

To skip logging on specific routes, publish the config (see above) and add route names or URIs to the ignore_routes array:


๐Ÿ“ Package Structure


๐Ÿงช Example: Full Controller Usage


๐Ÿข Multi-Tenant Setup (stancl/tenancy)

Agar aap stancl/tenancy (tenancy-for-laravel) use kar rahe hain toh neeche diye steps follow karo. Is package ki migration tenant database mein hogi aur har tenant apna alag activity log rakhega.


Step 1 โ€” Migration Publish Karke Tenant Folder Mein Move Karo

stancl/tenancy mein tenant migrations database/migrations/tenant/ folder mein honi chahiye.


Step 2 โ€” Tenancy Config Mein Migration Path Confirm Karo

config/tenancy.php mein check karo ke tenant migrations ka path sahi set hai:


Step 3 โ€” Tenant Migration Run Karo

Yeh command har tenant ke alag database mein activity_log_master table create kar degi.


Step 4 โ€” Naye Tenant Par Auto Migration

Jab naya tenant create ho toh automatically migration run ho โ€” app/Providers/TenancyServiceProvider.php mein confirm karo ke yeh configured hai:

Agar yeh set hai toh har naye tenant ke create hone par activity_log_master table automatically ban jayega.


Step 5 โ€” Tenant Context Mein Normal Use Karo

stancl/tenancy automatically tenant ka database switch karta hai. Package bilkul normal tarah use karo โ€” har tenant ka data automatically uske apne database mein jayega:


Step 6 โ€” Central App Se Specific Tenant Ka Log Dekhna

Agar aap central panel se kisi specific tenant ka log access karna chahte hain:


Tenant Default Log View

Tenant subdomain ya domain par default log view is URL par milega:

Har tenant ka /log sirf usi tenant ka data dikhayega.


Tenant Setup โ€” Quick Reference

Task Command
Migration publish karo php artisan vendor:publish --tag="migrations"
Migration move karo database/migrations/tenant/ folder mein
Sab tenants migrate karo php artisan tenants:migrate
Single tenant migrate karo php artisan tenants:migrate --tenants=id
Tenant rollback karo php artisan tenants:migrate --rollback
Config publish karo php artisan vendor:publish --tag="config"

โ“ FAQ

Q: Does it log guest (unauthenticated) users?
A: No, this package is designed for logged-in users only. It works best inside admin/user panels after authentication.

Q: Can I use my own view instead of the default /log page?
A: Yes! Use $activityLog->get($request) in your controller and pass the data to your own Blade view.

Q: How do I stop certain pages from being logged?
A: Publish the config file and add those route names or URIs to the ignore_routes array.

Q: Does it work with Laravel 12?
A: Yes, but you must manually register the provider in bootstrap/providers.php โ€” see the Register Service Provider section above.

Q: Does it support multi-tenancy with stancl/tenancy?
A: Yes! Move the published migration to database/migrations/tenant/, run php artisan tenants:migrate, and the package will work per-tenant automatically. See the Multi-Tenant Setup section for full details.


๐Ÿค Contributing

Contributions, issues, and feature requests are welcome!
Feel free to open an issue or submit a pull request.


๐Ÿ“„ License

This package is open-sourced software licensed under the MIT License.


๐Ÿ‘จโ€๐Ÿ’ป Author

Mian Zaid (Khalid Zaid)
๐ŸŒ quran.ahlesunat.com
๐Ÿ“ง [email protected]
๐Ÿ“ฆ Packagist | GitHub


If this package helped you, please consider giving it a โญ on GitHub!


All versions of activitylog with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
guzzlehttp/guzzle Version ^7.0.1
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 learncodeweb/activitylog contains the following files

Loading the files please wait ...