Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST http://localhost:8000/ajax/message/send 500 (Internal Server Error) #5

Closed
moritzwelsch opened this issue Jan 16, 2017 · 20 comments

Comments

@moritzwelsch
Copy link

moritzwelsch commented Jan 16, 2017

I implemented your example in my Project, but now i cant send any messages.

jquery.js:8625 POST http://localhost:8000/ajax/message/send 500 (Internal Server Error)
send @ jquery.js:8625
ajax @ jquery.js:8161
(anonymous) @ talk.js:16
dispatch @ jquery.js:4430
r.handle @ jquery.js:4116

@moritzwelsch moritzwelsch changed the title jquery.js:8625 POST http://localhost:8000/ajax/message/send 500 (Internal Server Error) POST http://localhost:8000/ajax/message/send 500 (Internal Server Error) Jan 16, 2017
@ed-i-arellano
Copy link

I have the same error when I send a message.

@nahid
Copy link
Owner

nahid commented Jan 21, 2017

please share your code with me.

@kingsleyzissou
Copy link

I had the same issue. I found that the auth::user() wasn't being set (I'm using Laravel 5.4).
What sorted it out for me was adding the following to the constructor of my controller:

$this->middleware(function ($request, $next) { Talk::setAuthUserId(Auth::user()->id); return $next($request); });

Hope that helps!

@ElBetito
Copy link

ElBetito commented Jun 6, 2017

@kingsleyzissou its works!!

@jbhoomi89
Copy link

Thanks It works fine!
It also solved trying to get property on non object error for me..
Thank you soo much!!

@nahid nahid closed this as completed Jul 3, 2017
@marslan2037
Copy link

@kingsleyzissou where i need to add this code ?

@kingsleyzissou
Copy link

@marslan2037 you place it inside the constructor and delete the line

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

So your constructor should look like this:

public function __construct()
{
    $this->middleware('auth');

    View::composer('partials.peoplelist', function($view) {
        $threads = Talk::threads();
        $view->with(compact('threads'));
    });

    $this->middleware(function ($request, $next) {
        Talk::setAuthUserId(Auth::user()->id);
        return $next($request);
    });
}

@marslan2037
Copy link

i have same error

@marslan2037
Copy link

500 interval server error

@marslan2037
Copy link

@kingsleyzissou this is what in preview tab
No connection could be made because the target machine actively refused it. [tcp://127.0.0.1:6379]

@kingsleyzissou
Copy link

@marslan2037 that's a different issue, it sounds like you need to setup redis on your computer and update the .env file with the correct information

@marslan2037
Copy link

what is redis ?

@marslan2037
Copy link

i update everything with pusher info

@marslan2037
Copy link

in env file and in talk.php also

@marslan2037
Copy link

preview tab shows this error, console shows 500 interval server error with message/send route

@marslan2037
Copy link

@kingsleyzissou i am using talk example, i did not add anything new in it, just did one change that have mention but same error, with and without that change

@kingsleyzissou
Copy link

@marslan2037 this issue is closed, the issue you're having is unrelated.

[tcp://127.0.0.1:6379] -> port 6739 is used for redis
You can go here for more info https://redis.io/

If you get redis setup on your machine it should resolve the issue.

@marslan2037
Copy link

@kingsleyzissou ok, but i did not install anything new in it, if package did not have it then i have it, let me reclone it and try again

@marslan2037
Copy link

@kingsleyzissou anyway thanks for your help

@alamintpi
Copy link

i am same problem here........plz help me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants