Download the PHP package teaminfinitydev/laravel-activity-log-discord without Composer

On this page you can find all versions of the php package teaminfinitydev/laravel-activity-log-discord. 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-activity-log-discord

Laravel Activity Log Discord

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

A powerful Laravel package that logs user activities and system events, then sends beautiful notifications to Discord channels via webhooks. Perfect for monitoring your application's important events in real-time.

๐ŸŒŸ Features

๐Ÿ“‹ Requirements

๐Ÿš€ Installation

Install the package via Composer:

Publish the configuration file:

Publish and run the migrations:

โš™๏ธ Configuration

Discord Webhook Setup

  1. Go to your Discord server settings
  2. Navigate to Integrations โ†’ Webhooks
  3. Create a new webhook for your desired channel
  4. Copy the webhook URL

Environment Configuration

Add the following to your .env file:

SSL Configuration

By default, this package uses SSL verification when connecting to Discord webhooks. This is recommended for production environments.

For Production Environments (Default):

The package uses the following Guzzle configuration by default, which includes SSL verification:

For Local Development or Troubleshooting:

If you're having connection issues in a local development environment or behind certain corporate firewalls, you may need to disable SSL verification temporarily:

  1. Open src/Services/DiscordWebhookService.php
  2. Find the client initialization in the constructor
  3. Change the verify option to false:

โš ๏ธ IMPORTANT SECURITY WARNING: Only disable SSL verification in local development environments. Never disable SSL verification in production as it makes your application vulnerable to man-in-the-middle attacks.

Test Your Integration

After configuration, test your webhook integration:

๐Ÿ“– Usage

Basic Usage

Manual Logging

Built-in Helper Methods

Automatic Model Tracking

Add the LogsActivity trait to your models for automatic tracking:

User Authentication Logging

Track user login/logout events automatically:

Application Bootup Monitoring

Enable bootup messages to monitor when your application starts:

This will send a message to Discord whenever your web application boots up, useful for monitoring deployments and server restarts.

๐Ÿงช Troubleshooting

Connection Issues

If you're experiencing issues connecting to Discord webhooks, try the following solutions:

1. Check Your Webhook URL

Ensure your Discord webhook URL is correctly formatted and valid. It should look like:

2. SSL Certificate Issues

If you receive a "No response from Discord (connection error)" error, you might be having SSL certificate issues, especially in a local development environment.

Temporary Fix (Development Only):

Modify the DiscordWebhookService.php file to disable SSL verification:

โš ๏ธ WARNING: Re-enable SSL verification (verify => true) before deploying to production!

3. Firewall or Network Issues

4. Detailed Debug Logging

Enable detailed logging to see what's happening with the connection:

Then check your Laravel logs for more information.

๐ŸŽจ Discord Message Examples

The package sends rich embed messages to Discord that look like this:

User Login Event

Application Bootup Event

Model Created Event

๐Ÿ“Š Database Schema

The package creates an activity_logs table with the following structure:

Column Type Description
id bigint Primary key
event_type string Type of event (e.g., 'user.login')
description text Human-readable description
subject_type string Model class of the subject
subject_id bigint ID of the subject model
causer_type string Model class of the causer
causer_id bigint ID of the causer model
properties json Additional event data
discord_sent boolean Whether sent to Discord
discord_sent_at timestamp When sent to Discord
created_at timestamp When the log was created
updated_at timestamp When the log was updated

๐Ÿ”ง Customization

Custom Event Colors and Icons

Modify config/activity-log-discord.php to customize event appearance:

Queue Configuration

For high-traffic applications, enable queue processing:

Don't forget to run your queue workers:

๐Ÿ“„ License

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


All versions of laravel-activity-log-discord with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version *
guzzlehttp/guzzle Version ^7.9
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 teaminfinitydev/laravel-activity-log-discord contains the following files

Loading the files please wait ...