Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error on dump or dd laravel adding a character before result

All request and dumps in laravel add a ^before a result, that's only do that in dd or dump

exemple of error

exemple dd Request:all()

This effect generate a lot of errors on my code, someone past some like that?

like image 348
Guilherme Freire Avatar asked Dec 02 '19 20:12

Guilherme Freire


People also ask

How to debug a variable in Laravel?

One of the most popular way of debugging in PHP still remains the same – showing variables in the browser, with hope to find what the error is. Laravel has a specific short helper function for showing variables – dd() – stands for “Dump and Die”, but it’s not always convenient.

What's wrong with Laravel's validator?

There is one problem with the accepted answer (and Laravel's Validator in general, in my opinion) - the validation process itself and validation status detection is merged into one method. If you blindly render all validation messages from the bag, it's no big deal.

What is the fastest way to write a Laravel script?

But if you want the script to literally “dump one simple variable and die” – then dd ($var) is probably the fastest to type. Like our articles? Check out our Laravel online courses!

Where are the Laravel support helpers loaded?

The laravel support helpers are loaded here. If the other helper functions are fine you can check the contents of laravel/framework/src/Illuminate/Support/helpers.php to see what's going on - this is where the function is created. I checked the dd function and it's the same as the source.


1 Answers

I had the same problem with laravel framework Lumen (5.8.12) and I solved the problem by returning to version 5.8.4.

The Origin of the problem seems to be the Symfony VarDumper Component (\vendor\symfony\var-dumper\Cloner\Data.php, line 302):

$dumper->dumpScalar($cursor, 'default', '^');

Should be:

 $dumper->dumpScalar($cursor, 'default', '');

Update

It is there for a useful reason. In terminal if you hover over the mouse on that ^ sign it will show you the file path from where this dump is coming from! I think it's really a useful thing but I don't see it working in browser. So, it should either be removed from borwser or fix the issue there.

like image 142
Gabriel Guzmán Avatar answered Oct 24 '22 19:10

Gabriel Guzmán