spatie / ray

Debug with Ray to fix problems faster
https://myray.app
MIT License
564 stars 102 forks source link

Laravel doesn't send data to ray app #713

Closed d-delaey closed 10 months ago

d-delaey commented 2 years ago

Describe the bug Laravel doesn't send data to ray app. I tried with an PHP-Error, ray() function and with dd().

Versions 2.0.1

You can use composer show to get the version numbers of:

PHP version: Laravel version ^9.19

To Reproduce Steps to reproduce the behavior: Just using ray(), dd() or making an PHP-Error

Expected behavior Corresponding data shown in Ray APp

Desktop (please complete the following information):

`<?php

return [ /*

`# For more information: https://laravel.com/docs/sail version: '3' services: laravel.test: build: context: ./vendor/laravel/sail/runtimes/8.1 dockerfile: Dockerfile args: WWWGROUP: '${WWWGROUP}' image: sail-8.1/app extra_hosts:

whitespacecode commented 1 year ago

@d-delaey check if your .env APP_ENV is set to local

octoxan commented 1 year ago

Doesn't work for me either. If I turn on logging of every single view or request, it logs, but ray('test'; or ray() anything doesn't do a thing.

d-delaey commented 1 year ago

@d-delaey check if your .env APP_ENV is set to local

it does

sardar1592 commented 1 year ago

Using Laravel sail. Nothing displaying in Ray despite following documentation.

whitespacecode commented 1 year ago

Check your .env that it's set to local

sardar1592 commented 1 year ago

https://github.com/spatie/ray/issues/713#issuecomment-1319653120

It is. I have tried everything. But nothing seems to work.

vdlsolutions commented 1 year ago

I ran into the same problem. It also didn't work for me in combination with Laravel sail on Windows 10.

I find the solution here: https://dev.to/stuartcreed/how-to-make-spatie-ray-work-with-laravel-sail-992

Steps to solve the problem: 1) sail composer require spatie/laravel-ray --dev 2) sail artisan ray:publish-config --docker 3) Add '127.0.0.1 host.docker.internal' to /etc/hosts 4) Set the values in ray.php to:

'host' => 'host.docker.internal', 'port' => 23517, 'remote_path' => '/var/www/html', 'local_path' => '/Users/me/projects/project'

Read the comments in the ray.php file for the correct paths.

SokratesP commented 1 year ago

I have the exact same problem. I have tried every step in the thread.

I only manage to get something on ray when I execute things from inside the project such as an artisan command, When I try to make a request to an endpoint that contains something to be logged on ray i get nothing.

flexchar commented 1 year ago

In my case ufw firewall was blocking. I typically have pleasure employing netcat to debug such issues.

Running nc -vz host.docker.internal 23517 was a great way to trace down. And running sudo ufw allow 23517 fixed the blocked issue.

jdecode commented 1 year ago

In my case ufw firewall was blocking. I typically have pleasure employing netcat to debug such issues.

Running nc -vz host.docker.internal 23517 was a great way to trace down. And running sudo ufw allow 23517 fixed the blocked issue.

This worked for me - and it makes sense : the OS has to allow a particular port before it can be used

Stupid me took much longer to realise this.

spatie-bot commented 10 months ago

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.