Giter VIP home page Giter VIP logo

talk-example's Introduction

Talk Example

This is a demo project for Laravel-Talk package. You can learn from here how to use Talk.

Announcement

Yes, now Talk Example project is Docker ready.

Requirements

  • Docker
  • Docker Compose

Configurations

If you want to use our default settings then you didn't need to configure anything except Pusher credentials.

But if you want to configure as you want then copy .env.example to .env

cp .env.example .env

then configure your desire settings

and now copy docker-compose.yml.example to docker-compose.yml and configure as you want

cp docker-compose.yml.example docker-compose.yml

Thats it

Installation

There are no extra panic to install this project just run this command and enjoy

./talk ready

Chill!

What contains with Docker?

  • PHP 7.1.1
  • Nginx
  • MySQL 5.7
  • Redis
  • Supervisor
  • Git
  • GD Library
  • Zip Library

So you no need to Install PHP, no need to manage queue, our system will manage all queue, worker and database system with auto migration and seeding. Cool nah?

For Realtime

If you want to get realtime service from this app you have to configure it first. Goto config/talk.php and enable broadcast. After enabling broadcast please set the Pusher app credentials in pusher section.

return [
    'user' => [
        'model' => 'App\User'
    ],
    'broadcast' => [
        'enable' => false,
        'app_name' => 'talk-example',
        'pusher' => [
            'app_id'        => env('PUSHER_APP_ID'),
            'app_key'       => env('PUSHER_KEY'),
            'app_secret'    => env('PUSHER_SECRET')
        ]
    ]
];

Now open you project in browser and goto http://localhost:8088. Then login with the given user credentials

email: [email protected] password: 123456

So, Lets start you journey :)

Here is a project screenshot that was developed by Talk.

Talk-Example Screenshot

Template Credit

Template - Live chat window widget by SergioGalindo

talk-example's People

Contributors

andreybashuk avatar h4yfans avatar nafiesl avatar nahid avatar nazmulpcc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

talk-example's Issues

Error in broadcast.pl

Hi!
I am trying to install talk-example. I did everything what is on git but i have this... What can I do?

In env I have:
PUSHER_APP_ID=
PUSHER_KEY=
PUSHER_SECRET=

screenshot from 2017-10-20 20-51-07

getaddrinfo failed

ConnectionException in AbstractConnection.php line 155:
php_network_getaddresses: getaddrinfo failed: Name or service not known [tcp://redis:6379]

Does anyone know how to fix it?

How to install?

Hi, Nahid
I read this part in the readme.md
./talk ready What is this?
How to install? I use windows10.
I can't send message. I got the redis issue. I think the reason is in the installation.
Please help me

Messages sent but chat page doesn't reload with them.

1: When I clicked Send button.

I don't use docker for this example, could be that the reason?...
Actually using XAMPP, running the migrations on port 8088 with php artisan serve.

Psdata:

The messeges are stored in db but not retrieved automatically.
1

How can I send attachment?

Hi, Nahid
I want to use your package in my webapp.
But i need to send attachment via chatbox.
I found the attachment migration file in the migrations folder.
But i can't send attachment.
How can i send attachment?
I hope you show me sample.
Best Reguards.

Real time chat update not happening from pusher

Hello,
I have tried this talk example. I can check in multiple browser, I have created account in Pusher and I have updated the credentials in the .env file. Even I have run the PHP artisan queue:listen and redis-cli monitor. I can see the data receiving in queue and Redis also. But I didn't get the data in pusher account debug console and also not happening live update in other end. Is there any configuration missing my side or I need to do any extra step on this for live update. Could you please help me on this. I'm struggling on this last 3 days.

Pusher Error.

Thanks for this package, I have installed successfully, but cannot get live messaging working.

the relevant lines in .env:

PUSHER_APP_ID=3***12
PUSHER_KEY=d5f******5f693471e49
PUSHER_SECRET=875e******2f4c003408

[reals creds are correct, these changed for security]

the relevant lines in talk.php (this file is not in app/ as stated, but in config/

'user' => [
        'model' => 'App\User'
    ],
    'broadcast' => [
        'enable' => true,
        'app_name' => 'talktest-development',
        'pusher' => [
            'app_id'        => env('PUSHER_APP_ID'),
            'app_key'       => env('PUSHER_KEY'),
            'app_secret'    => env('PUSHER_SECRET'),
            'options' => [
                 'cluster' => 'eu',
                 'encrypted' => true
            ]
        ]
    ]

The result; no matter what I do, I always get the same pusher error regarding the cluister. I have set it to EU in the pusher app, and using the provided code on the debugging tab I have successfully sent test messages using only the composer require. The error message in the console:

Pusher : Error : {"type":"WebSocketError","error":{"type":"PusherError","data":{"code":4001,"message":"Did you forget to specify the cluster when creating the Pusher instance? App key d5f*****5f693471e49 does not exist in this cluster."}}}

I've tried creating new apps, putting them in the us cluster with no change at all. It behaves as if the cluster option is not being properly supplied? (maybe ^^)

Would appreciate any guidance anyone can give :)
Thanks.

Unable to do composer install

after downloading package, when i do composer install, it gives this error,

Source path "pkgs/nahid/talk" is not found for package nahid/talk

Class talk does not exist

Am getting this error when i click on send message button on home page.

ReflectionException in compiled.php line 1479:
Class talk does not exist

Pls help

Pusher Trigger Problem when i sent the message Broadcast->dispatch is not working

Can please help what is the issue here? I config and setup done. but Broadcast->dispatch is not working

[2022-03-24 07:33:05] local.ERROR: {"userId":3,"exception":"[object] (Pusher\ApiErrorException(code: 0): at C:\xampp\htdocs\fm\script\vendor\pusher\pusher-php-server\src\Pusher.php:533)
[stacktrace]
#0 C:\xampp\htdocs\fm\script\vendor
ahid\talk\src\Live\Webcast.php(55): Pusher\Pusher->trigger(Array, 'talk-send-messa...', Array)

#20 C:\xampp\htdocs\fm\script\vendor
ahid\talk\src\Live\Broadcast.php(85): Nahid\Talk\Live\Broadcast->dispatch(Object(Nahid\Talk\Live\Webcast))
#21 C:\xampp\htdocs\fm\script\vendor
ahid\talk\src\Talk.php(106): Nahid\Talk\Live\Broadcast->transmission(Object(Nahid\Talk\Messages\Message))
#22 C:\xampp\htdocs\fm\script\vendor
ahid\talk\src\Talk.php(262): Nahid\Talk\Talk->makeMessage(2, Object(Nahid\Talk\Messages\Message))

Pusher

Does it work out of the box with pusher or some other service ?

Where you make model in larvel

hi nahid ,

Pls tell where you make table for chat in laravel. I can not find the table in code not in the database.
So can i want to change the table name.

RelationNotFoundException

Hi, all,
Sorry, I am new to laravel.
I got this issue when I was trying to send a message to someone. The list of contacts can be displayed. Not sure what the possible issue is?
Thank you very much for checking this.
1511958236852

Another doubt is that after I entered "php artisan queue:listen ", no response was displayed, is it normal?
1511958716628

bootstrap.js

check your assets/js/bootstrap.js file there are errors in it

Issue with redis

php_network_getaddresses: getaddrinfo failed: Name or service not known [tcp://redis:6379]

I am getting following error though my redis enabled. Please help.

Editing avatars

Hallo!
How can I edit avatars in peoplelist? When I have something like this only clicled user has avatar... Can you help me? I tried almost everything

<li class="clearfix">
            <a href="{{route('message.read', ['id'=>$inbox->withUser->id])}}">
            @foreach($user->where('user_id', $inbox->withUser->id) as $data)
                    @if(empty($data->avatar))
                      <img src="{{ asset('img/lock_thumb.jpg')}}" class="avatar" alt="avatar">      
                    @else
                      <img src="{{ asset('/av/'. $data->avatar) }}" class="avatar" alt="avatar">  
                    @endif
                  @endforeach
            <div class="about">
                <div class="name">{{$inbox->withUser->name}}</div>
                <div class="status">
                    @if(auth()->user()->id == $inbox->thread->sender->id)
                        <span class="fa fa-reply"></span>
                    @endif
                    <span>{{substr($inbox->thread->message, 0, 20)}}</span>
                </div>
            </div>
            </a>
        </li>

Pusher Error

These are the steps i follow

  1. Download latest zip file,
  2. run command ./talk ready
  3. composer install
  4. add pusher credentials
  5. php artisan migrate
  6. create account
  7. click on message button
    and it gives error

Pusher : Error : {"type":"WebSocketError","error":{"type":"PusherError","data":{"code":4001,"message":"Did you forget to specify the cluster when creating the Pusher instance? App key ff002e63cfa0ec7812c0 does not exist in this cluster."}}}

can you please help me on this, i have docker installed in my laptop

messages are not divied into conversations

i've made 3 different accounts. when user1 is typing with user2 , and in this time recive a message from user3 , this message is appering in user1-user2 conversation not in user1-user3
i think channels are not correct made

PHP Version Issue

'composer install' shows error:

vinkla/pusher 2.5.0 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.

Please run: 'composer update' first and then try install

Unable to install Pusher

Hello,

I wanted to install pusher using this command composer require pusher/pusher-php-server so i can make notifications of new messages from Laravel Talk but i get this error whenever i try to install pusher
capture

Server pusher don't send message to pusher debug console

Hi.
I installed nahid talk v2.2.1 on laravel 5.2. Using talk_live helper, subscription messages are visible in debug console in pusher account. But server pusher don't send any message to the pusher.com server. My config in talk.php is correct. In the Broadcast.php $pusher object is ok but $pusher->get_channels() returns null.

I traced the code in ajaxSendMessage. Then Talk::sendMessageByUserId($userId, $body) called. Then sendMessageByUserId. Then makeMessage inside Talk.php. Then line
$this->broadcast->transmission($message);
transmission in Broadcast.php returns false because the $pusher is null.

I noticed to the Debug Console in pusher, about 5 seconds after subscription to the channels, channels Disconnection occur in some cases.

Pusher didnt receive the request

Hello Nahid,

I followed all the steps but it ain't work ! it works only if i refresh the page :(
Can u tell us a way to set a debug mode ?

I'm using Pusher, when i post a message, its not even count in pusher dashboard and i have no errors when inspecting ajax post request on my browser.

Config/talk

<?php
return [
    'user' => [
        'model' => 'App\User'
    ],
    'broadcast' => [
        'enable' => true,
        'app_name' => 'laravel-iehr-talk',
        'pusher' => [
            'app_id'        => env('PUSHER_APP_ID'),
            'app_key'       => env('PUSHER_KEY'),
            'app_secret'    => env('PUSHER_SECRET'),
            'options' => [
                 'cluster' => 'eu',
                 'encrypted' => true
            ]
        ]
    ]
];

.env

PUSHER_APP_ID='366090'
PUSHER_KEY='774fd532de1980fb8bf3'
PUSHER_SECRET='******secret*****'

artisan
dsqe

Alex

Conflict with Pusher PHP server v^3.0

There seems to be a conflict between this package and pusher-php-server v3.0 onwards. Here are the errors I encounter while trying out a composer update . Any fixes or a possible workaround for this?

`"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3.",
"sebastian-berc/repositories": "^1.0",
"yohang88/letter-avatar": "^1.0",
"vinkla/pusher": "^3.0",
"pusher/pusher-php-server": "^3.0",
"predis/predis": "^1.1",
"nahid/talk": "^2.2"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.
",
"phpunit/phpunit": "~5.0",
"symfony/css-selector": "3.1.",
"symfony/dom-crawler": "3.1.
"
},

`

`Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- nahid/talk v2.2.1 requires pusher/pusher-php-server ^2.6 -> satisfiable by pusher/pusher-php-server[2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.x-dev, v2.6.0] but these conflict with your requirements or minimum-stability.
- nahid/talk v2.2.0 requires pusher/pusher-php-server ^2.6 -> satisfiable by pusher/pusher-php-server[2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.x-dev, v2.6.0] but these conflict with your requirements or minimum-stability.
- Installation request for nahid/talk ^2.2 -> satisfiable by nahid/talk[v2.2.0, v2.2.1].`

I wasn't able to run the demo

Salam @nahid Bhai,

I tried to run the demo. But wasn't able to do it.

So if you would walk me through this. It would be very easy for me.

when i execute ./talk ready it doesn't work

Thanks

Your requirements could not be resolved to an installable set of packages.

hello

I have problem with
composer require nahid/talk
help me please

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - nahid/talk v2.2.1 requires pusher/pusher-php-server ^2.6 -> satisfiable by pusher/pusher-php-server[2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.x-dev, v2.6.0] but these conflict with your requirements or minimum-stability.
    - nahid/talk v2.2.0 requires pusher/pusher-php-server ^2.6 -> satisfiable by pusher/pusher-php-server[2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.x-dev, v2.6.0] but these conflict with your requirements or minimum-stability.
    - Installation request for nahid/talk ^2.2 -> satisfiable by nahid/talk[v2.2.0, v2.2.1].


Installation failed, reverting ./composer.json to its original content.

this is composer.json

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.4",
        "laravel/framework": "5.3.*",
        "sebastian-berc/repositories": "^1.0",
        "yohang88/letter-avatar": "^1.0",
        "vinkla/pusher": "^3.0",
        "pusher/pusher-php-server": "^3.0",
        "predis/predis": "^1.1",
        "nahid/talk": "^2.2"
    },
    "require-dev": {
{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.4",
        "laravel/framework": "5.3.*",
        "sebastian-berc/repositories": "^1.0",
        "yohang88/letter-avatar": "^1.0",
        "vinkla/pusher": "^3.0",
        "pusher/pusher-php-server": "^3.0",
        "predis/predis": "^1.1",
        "nahid/talk": "^2.2"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~5.0",
        "symfony/css-selector": "3.1.*",
        "symfony/dom-crawler": "3.1.*"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        },
        "files": [
{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.4",
        "laravel/framework": "5.3.*",
        "sebastian-berc/repositories": "^1.0",
        "yohang88/letter-avatar": "^1.0",
        "vinkla/pusher": "^3.0",
        "pusher/pusher-php-server": "^3.0",
        "predis/predis": "^1.1",
        "nahid/talk": "^2.2"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~5.0",
        "symfony/css-selector": "3.1.*",
        "symfony/dom-crawler": "3.1.*"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        },
        "files": [
        ]
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

Call to undefined function talk_live()

After following all install instructions and set pusher configurations , I got this error at end of conversation page :

FatalErrorException in 1903760f40f5627c0ec3eadb405d29c4805b8745.php line 91:
Call to undefined function talk_live()

I searched all project filed and did not found any talk_live() function declaration.

Help in installing on a real project

Hi, thank for your job, this repository in full satisfy the need for my project bad one problem I don't know how to install this example in my project, I tried but brought this error to the main screen InvalidArgumentException in AuthManager.php line 86: Auth guard [user] is not defined. what to do?
How can I insert talk-example into my applications?

Unread and Read messages count

There is no function for read or unread message count. I can make my custom functions, but it increases the number of queries, which is not feasible for my system.
Please help.

cannot migrate

Warning: require(C:\xampp\htdocs\chat\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\chat\bootstrap\autoload.php on line 17

Fatal error: require(): Failed opening required 'C:\xampp\htdocs\chat\bootstrap/../vendor/autoload.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\chat\bootstrap\autoloa
d.php on line 17

Laravel code issue in talk example

Dear sir,

I download the code for the github and also run the composer command .but In my localhost not working
there coming an error.The error is this "Fatal error: Class 'Illuminate\Foundation\Application' not found in C:\xampp2\htdocs\talk\bootstrap\app.php on line 14". so please help me for the solve this problem .

So i can run the code in local and see talk example how it is work..

Invalid request (Unexpected EOF)

hello,
Thank you for this package. Very helpful.
I am obliged to refresh the page to see the new messages.
After refresh or after sending a message, I have this error on the console.
Invalid request (Unexpected EOF)

can you help me to fix it ?
Tank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.