Download the PHP package harshaaliaschinna/ping without Composer

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

Laravel Messaging or Chat or Conversation Package (Ping)

[Ping Logo]()

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

Configuration

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

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

Migration

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

Finally run below command to execute migrations.

Basic Usage

Example 1:

Example 2:

Example 3:

API Reference

Method V0.1
setId() :heavy_check_mark:
send() :heavy_check_mark:
new() :heavy_check_mark:
exists() :heavy_check_mark:
receive() :heavy_check_mark:
receiveAll() :heavy_check_mark:
totalConnections() :heavy_check_mark:
unreadCount() :heavy_check_mark:
markAsSeen() :heavy_check_mark:
markUnreadAsSeen() :heavy_check_mark:
hasAccess() :heavy_check_mark:
delete() :heavy_check_mark:
hardDelete() :heavy_check_mark:
hardDeleteAll() :heavy_check_mark:
hardDeleteConnection() :heavy_check_mark:
hardDeleteConnectionByUserId() :heavy_check_mark:

**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!*** :stuck_out_tongue: .

setId

This method sets the base Id known as base_user. From which the requests can be made.

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

Return Values:
Returns Ping object. FALSE on errors.

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.

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

Creates new connection between users.

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

Checks whether a connection exists between base_user and provided user.

Parameters:
user_two: Unique Id. This method is dependent on setId()

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

receive

Retrives a message using message_id.

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

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

Parameters:
connection_id: Connection id.
seen: Mark unread messages as seen by base_user. Default it will be as false.

Value Result
true Mark as seen
false Ignore

order: Order by ascending order or descending order using messages timestamp.

Value Result
ASC Ascending order
DESC Descending 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

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

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

Retrives unread messages count based on connection_id.

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

Mark a message as seen.

Parameters:
message_id: Message Id should be passed.

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

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.

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

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

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

To delete a message from one user side.

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

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

Parameters:
message_id: Specific message_id should be passed.

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

hardDeleteAll

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

Parameters:
connection_id: Specific connection_id should be passed.

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

hardDeleteConnection

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

Parameters:
connection_id: Specific connection_id should be passed.

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

hardDeleteConnectionByUserId

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

Parameters:
user_id: Specific user_id should be passed.

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


All versions of ping with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.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 harshaaliaschinna/ping contains the following files

Loading the files please wait ....