PHPackages                             harshaaliaschinna/ping - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. harshaaliaschinna/ping

ActiveLibrary[Queues &amp; Workers](/categories/queues)

harshaaliaschinna/ping
======================

Ping provides a simple and easy Messaging or Chat or Conversation system to your Laravel Framework.

v0.1-p1(8y ago)6701[1 issues](https://github.com/harshaaliaschinna/ping/issues)MITPHPPHP &gt;=5.4.0

Since Jul 25Pushed 8y ago3 watchersCompare

[ Source](https://github.com/harshaaliaschinna/ping)[ Packagist](https://packagist.org/packages/harshaaliaschinna/ping)[ RSS](/packages/harshaaliaschinna-ping/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

Laravel Messaging or Chat or Conversation Package (Ping)
========================================================

[](#laravel-messaging-or-chat-or-conversation-package-ping)

![Ping Logo](https://camo.githubusercontent.com/1d4453d5ad4bfbd568d5a7e426a28d05a2e914a43a1ae16f5bb386d587c1da0a/687474703a2f2f692e696d6775722e636f6d2f7a4475387837732e706e67)

Introduction
------------

[](#introduction)

**Ping** provides a simple and easy Messaging or Chat or Conversation system to your Laravel Framework. It is easy to integrate and use.

Features
--------

[](#features)

- One to One Conversation.
- Send a message without checking for conversation.
- Check if user has access to a conversation.
- Conversation's unread messages count (total &amp; by user).
- Retriving messages with auto marking as seen.
- Marking all unread messages as seen (total &amp; by user).
- Deleting messages from the participant side.
- Hard deletion (delete permanently) of messages and conversation.
- Message Encryption (*Coming soon!*).
- Group Conversation (*Coming soon!*).

Installation
------------

[](#installation)

To get started with Ping, use Composer to add the package to your project:

```
composer require harshaaliaschinna/ping

```

Configuration
-------------

[](#configuration)

After installing the Ping package, register the `Harshaaliaschinna\Ping\PingServiceProvider` in your `config/app.php` configuration file:

```
'providers' => [
    // Other service providers...

    Harshaaliaschinna\Ping\PingServiceProvider::class,
],
```

You don't need to add the Ping to alias array. We already done that for you 💙.

Migration
---------

[](#migration)

Run below command in your terminal to publish required migration files for this package.

```
php artisan vendor:publish --provider="Harshaaliaschinna\Ping\PingServiceProvider"

```

Finally run below command to execute migrations.

```
php artisan migrate

```

Basic Usage
-----------

[](#basic-usage)

Example 1:

```
// Ping::setId(from_id)->send(to_id, message);
Ping::setId(1)->send(2, "Hello, How are you?");
```

Example 2:

```
Ping::setId(1);
Ping::send(2, "Hello, How are you?");
```

Example 3:

```
namespace App\Controllers;

..
use Ping;

class Demo extends Controller {
    public function __construct() {
        // Ping once initialized it can be used anywhere without setting From Id.
        Ping::setId(Auth::Id());
    }

    public function sendMessage($toId, $message) {
        ..
        ..
        Ping::send($toId, $message);
        ..
    }

    public function retriveMessage($Id) {
        ..
        $markAsSeen = true; // Bool
        $message = Ping::recieve($Id, $markAsSeen);
        ..
    }
    ..
    ..
    ..
}
```

API Reference
-------------

[](#api-reference)

MethodV0.1[setId()](#setid)✔️[send()](#send)✔️[new()](#new)✔️[exists()](#exists)✔️[receive()](#receive)✔️[receiveAll()](#receiveall)✔️[totalConnections()](#totalconnections)✔️[unreadCount()](#unreadcount)✔️[markAsSeen()](#markasseen)✔️[markUnreadAsSeen()](#markunreadasseen)✔️[hasAccess()](#hasaccess)✔️[delete()](#delete)✔️[hardDelete()](#harddelete)✔️[hardDeleteAll()](#harddeleteall)✔️[hardDeleteConnection()](#harddeleteconnection)✔️[hardDeleteConnectionByUserId()](#harddeleteconnectionbyuserid)✔️\****Note:*** Please note that **connection** and **conversation** both are same. As the package name itself refers to a Networking scenario, these words were used ***just for fun!*** 😛 .

### setId

[](#setid)

This method sets the base Id known as **base\_user**. From which the requests can be made.

```
object setId( int $id )
```

**Parameters:**
***Id:*** Unique Id from which further requests can be performed.

**Return Values:**
Returns Ping object. **FALSE** on errors.

### send

[](#send)

Sends the message to other user. This method creates automatically a new connection if there is no connection between users. If there exists a connection already it will use it to send message.

```
object send( int $to_id, string $message)
```

**Parameters:**
***to\_id:*** Unique Id to which the message to be sent.
***message:*** The message field.

**Return Values:**
Returns object on Success. **FALSE** on errors.
object returned containes newly sent message id `->id`. It also containes connection id `->connection_id` and few others.

### new

[](#new)

Creates new connection between users.

```
object new( int $user_one[, int $user_two = null])
```

**Parameters:**
***user\_one:*** Unique Id.
***user\_two:*** If this field is not set, Ping will create a connection between **base\_user**(user set through `setId()` method) and user\_one. Else it will create a connection between user\_one and user\_two.

**Return Values:**
Returns object on Success. **FALSE** on errors.
returned object containes Connection id `->id`

### exists

[](#exists)

Checks whether a connection exists between **base\_user** and provided user.

```
bool exists( int $user_two)
```

**Parameters:**
***user\_two:*** Unique Id. This method is dependent on `setId()`

**Return Values:**
Returns object on Success. **FALSE** on errors.

### receive

[](#receive)

Retrives a message using message\_id.

```
object receive( int $message_id[, $seen = false])
```

**Parameters:**
***message\_id:*** Message id should be passed to retrive message.
***seen:*** Mark this message as seen.

**Return Values:**
Returns object on Success. **FALSE** on errors or not found.

### receiveAll

[](#receiveall)

Retrives all messages that are present in a connection or conversation using `connection_id`

```
object receiveAll( int $connection_id[[[[, bool $seen = false], string $order = 'ASC'], int $skip=null], int $take=null])
```

**Parameters:**
***connection\_id:*** Connection id.
***seen:*** Mark unread messages as seen by `base_user`. Default it will be as `false`.

ValueResulttrueMark as seenfalseIgnore***order:*** Order by ascending order or descending order using messages timestamp.

ValueResultASCAscending orderDESCDescending order***skip:*** number of messages to skip.
***take:*** number of messages to retrive.

**Return Values:**
Returns object on Success. **FALSE** on errors or not found.

### totalConnections

[](#totalconnections)

Retrives all connections that are linked to `base_user` or provided user.

```
object totalConnections([int $user_id=null])
```

**Parameters:**
***user\_id:*** If `user_id` is passed, Ping will retrive all connections based on provided `user_id`. Else it will use `base_user` as `user_id` and retrives all connections.

**Return Values:**
Returns object on Success. **FALSE** on errors or not found.

### unreadCount

[](#unreadcount)

Retrives unread messages count based on `connection_id`.

```
int unreadCount( int $connection_id[, int $user_id=null])
```

**Parameters:**
***connection\_id:*** If `user_id` is passed, Ping will retrive all unread messages count based on provided `user_id`. Else it will use `base_user` as `user_id` and retrives the count.
***user\_id:*** If `user_id` is passed, Ping will set it as `base_user` and retrives unread message count. Else it will use `base_user` as `user_id` and retrives it.

**Return Values:**
Returns integer on Success. **FALSE** on errors or not found.

### markAsSeen

[](#markasseen)

Mark a message as seen.

```
bool markAsSeen( int $message_id)
```

**Parameters:**
***message\_id:*** Message Id should be passed.

**Return Values:**
Returns `true` on Success. **FALSE** on errors or not found.

### markUnreadAsSeen

[](#markunreadasseen)

Mark all unread messages as seen using `connection_id`. If `user_id` is passed it will mark that user specific received messages as seen. Else it will mark all messages as seen in that particular connection.

```
bool markUnreadAsSeen( int $conection_id[, int $user_id = null])
```

**Parameters:**
***connection\_id:*** Specific `connection_id` should be passed.
***user\_id:*** If `user_id` is passed it will mark that users received messages as seen.

**Return Values:**
Returns `true` on Success. **FALSE** on errors or not found.

### hasAccess

[](#hasaccess)

Checks whether a user has access to specific connection or not.

```
bool hasAccess( int $connection_id[, int $user_id = null])
```

**Parameters:**
***connection\_id:*** Specific `connection_id` should be passed.
***user\_id:*** If `user_id` is passed, Ping will check whether the given `user_id` has access to connection or not. Else it will use `base_user` as `user_id` and checks for access.

**Return Values:**
Returns `true` if user has access. **FALSE** if they don't have access.

### delete

[](#delete)

To delete a message from one user side.

```
bool delete( int $message_id[, int $user_id=null])
```

**Parameters:**
***message\_id:*** Specific `message_id` should be passed.
***user\_id:*** If `user_id` is passed, Ping will remove message from that user side. Else it will use `base_user` as `user_id` and removes from that user side.

**Return Values:**
Returns `true` on Success. **FALSE** on errors or not found.

### hardDelete

[](#harddelete)

Message will be deleted permanently from database. Any user present in that connection cannot retrive this message again.

```
bool hardDelete( int $message_id)
```

**Parameters:**
***message\_id:*** Specific `message_id` should be passed.

**Return Values:**
Returns `true` on Success. **FALSE** on errors or not found.

### hardDeleteAll

[](#harddeleteall)

This will delete all the messages permanently in a connection. In other words it will reset that connection.

```
bool hardDeleteAll( int $connection_id)
```

**Parameters:**
***connection\_id:*** Specific `connection_id` should be passed.

**Return Values:**
Returns `true` on Success. **FALSE** on errors or not found.

### hardDeleteConnection

[](#harddeleteconnection)

This will delete a connection &amp; messages present in it permanently.

```
bool hardDeleteConnection( int $connection_id)
```

**Parameters:**
***connection\_id:*** Specific `connection_id` should be passed.

**Return Values:**
Returns `true` on Success. **FALSE** on errors or not found.

### hardDeleteConnectionByUserId

[](#harddeleteconnectionbyuserid)

This is same as `hardDeleteConnection()` but this method will accept `user_id` as parameter. Connection &amp; messages that exists between `base_user` and provider `user_id` will be deleted permanently.

```
bool hardDeleteConnectionByUserId( int $user_id)
```

**Parameters:**
***user\_id:*** Specific `user_id` should be passed.

**Return Values:**
Returns `true` on Success. **FALSE** on errors or not found.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

2

Last Release

3208d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7817388b803e5082a1a04208a2d7cfabed01533d81a7c7279946d111406c56a5?d=identicon)[harshaaliaschinna](/maintainers/harshaaliaschinna)

---

Top Contributors

[![harshaaliaschinna](https://avatars.githubusercontent.com/u/11741363?v=4)](https://github.com/harshaaliaschinna "harshaaliaschinna (3 commits)")

---

Tags

chatchat-applicationchatappconversationconversation-servicelaravellaravel-5-packagelaravel-packagemessagemessagingmessaging-apimessaging-servicesmessagelaravelmessagingchatmessage-system

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/harshaaliaschinna-ping/health.svg)

```
[![Health](https://phpackages.com/badges/harshaaliaschinna-ping/health.svg)](https://phpackages.com/packages/harshaaliaschinna-ping)
```

###  Alternatives

[nahid/talk

Talk is a Laravel based realtime messaging, chatting and conversation system. It helps to develop users messaging, chatting and conversations in easy way.

1.6k58.1k4](/packages/nahid-talk)[arcanedev/laravel-messenger

Simple messaging system for Laravel

891.5k](/packages/arcanedev-laravel-messenger)[baklysystems/laravel-chat-messenger

Laravel chat package

121.8k](/packages/baklysystems-laravel-chat-messenger)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
