talk 0 travis-ci Packagist phpunit

Talk is a Laravel 5 based user conversation (inbox) system.

Laravel-Talk

Talk is a Laravel 5 based user conversation (inbox) system. You can easily integrate this package with any Laravel based project. It helps you to develop a messaging system in just 25 mins. So let's start :)

Talk Screenshot

Installation

Talk is a Laravel package so you can install it via composer. Run this command in your terminal from your project directory.

composer require nahid/talk

Wait for a while, Composer will automatically install Talk in your project.

Configuration

When the download is complete, you have to call this package service in config/app.php config file. To do that, add this line in app.php in providers section

Nahid\Talk\TalkServiceProvider::class,

To use facade you have to add this line in app.php in aliases array

'Talk'      => Nahid\Talk\Facades\Talk::class,

Now run this command in your terminal to publish this package resources

php artisan vendor:publish --provider="Nahid\Talk\TalkServiceProvider"

After running this command, all necessary file will be included in your project. This package has two default migrations. So you have to run migrate command like this. (But make sure your database configuration is configured correctly.)

php artisan migrate

Okay, now you need to configure your user model for Talk. Go to config/talk.php and config it.

return [
    'user' => [
        'table' => 'your_users_table_name',
        'model' => 'User\Model',
        'columns' => ['column1', 'column2']
    ]
];

[NB: Here columns mean, the columns that you want should be used for inbox queries]

Usage

Its very easy to use. First you have to set authenticate user id to Talk.

Talk::setAuthUserId(auth()->user()->id);

Now you may use any method what you need. Please see the API Doc.

API List

setAuthUserId

setAuthUserId method sets the user id, which you pass through parameter

Syntax

void setAuthUserId($userid)

isConversationExists

This method checks currently logged in user and if given user is already in conversation

Syntax

int/false isConversationExists($userid)

isAuthenticUser

isAuthenticUser checks if the given user exists in given conversation.

Syntax

boolean isAuthenticUser($conversationId, $userId)

sendMessage

You can send messages via conversation id by using this method. If the message is successfully sent, it will return objects of Message model otherwise, it will return false

Syntax

object/false sendMessage($conversationId, $message)

sendMessageByUserId

You can send message via receiver id by using this method. If the message is successfully sent, it will return objects of Message model otherwise, it will return false

Syntax

object/false sendMessageByUserId($userId, $message)

getInbox

If you want to get all the inboxes, this method may help you. This method gets all the inboxes via given user id

Syntax

object getInbox([$offset[, $take]])

getInboxAll

If you want to get all the inboxes with soft deleted messages, this method may help you. This method gets all the inboxes via given user id

Syntax

object getInboxAll([$offset[, $take]])

getConversationsById

When you want to get all the conversations using your desire conversation id, you can try this method. This method returns all the conversations with user's objects

Syntax

object getConversationsById($conversationId)

getConversationsByUserId

When you want to get all the conversations using your desire receiver id, you can try this method. This method returns all the conversations with user's objects

Syntax

object getConversationsByUserId($receiverId)

getReceiverInfo

This method returns all the information about message receiver.

Syntax

object getReceiverInfo($conversationId)

makeSeen

If you want to set a message as seen you can use this method.

Syntax

boolean makeSeen($messageId)

deleteMessage

When you want to delete a specific message from a conversation, you have to use this method. This method soft delete message for both user-end individually.

Syntax

boolean deleteMessage($messageId)

deleteForever

If you want to hard delete or permanently delete a specific message then you have to use this method

Syntax

boolean deleteForever($messageId)

deleteConversations

This method is used to permanently delete all conversations

Syntax

boolean deleteConversations($conversationId)

Special Thanks To

Shipu Ahamed

Thanks :)

Support for this project

Hey dude! Help me out for a couple of :beers:!

Beerpay Beerpay

Related Repositories

angular-d3-talk

angular-d3-talk

angular-d3-talk ...

rust-out-your-c-talk

rust-out-your-c-talk

Slides and resources for my talk "Rust out your C", first given at Pittsburgh Te ...

2015-06-28_r-summit-talk

2015-06-28_r-summit-talk

Talk at R Summit and Workshop about using R Markdown and GitHub in your workflow ...

2015-02-23_bryan-fields-talk

2015-02-23_bryan-fields-talk

Talk at Workshop on Visualization for Big Data: Strategies and Principles, Field ...

jsconfeu-talk

jsconfeu-talk

Source code for my September 2013 talk at JSConfEU. ...


Top Contributors

nahid ptondereau SumonMSelim baileylo harry34 invalid-email-address

Dependencies

package version
php >=5.5.9
illuminate/contracts 5.0.* || 5.1.* || 5.2.* || 5.3.* || 5.4.*
illuminate/support 5.0.* || 5.1.* || 5.2.* || 5.3.* || 5.4.*
sebastian-berc/repositories ^1.0
nesbot/carbon ^1.21
pusher/pusher-php-server ^2.6
dev graham-campbell/testbench ^3.1
phpunit/phpunit ^4.8 || ^5.0

Releases

-   1.1.6 zip tar
-   1.1.5 zip tar
-   1.1.4 zip tar
-   1.1.3 zip tar
-   1.1.2 zip tar
-   1.1.1 zip tar
-   1.1.0 zip tar
-   1.0.1 zip tar