V
V
Venya Babiyman2020-06-08 07:19:50
Laravel
Venya Babiyman, 2020-06-08 07:19:50

Output of print_r($request) Laravel 6.0?

Two questions:
1. Why can't the $request variable be output in Laravel (memory fills up)?
2. How to see the "guts" of the Laravel framework?
In some PHP frameworks you can, for example, print_r($this) in the controller.
In some Perl frameworks, you can, for example, print Dumper(shift) in the controller.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Deniskin, 2020-06-08
@romka123

1. It's all about recursive method calls. When you call the $request variable, a bunch of methods that call themselves twitch and you run out of memory. To view the contents of a variable, you can use the toArray() function, like so: dd($request->toArray());
2. Look into the vendor folder, of course. You can also debug with X-debug. But as a rule, you almost never need it. Read the documentation, ask questions about how to do something specific, if something is not clear and you will be prompted how to do it right. For this, the framework has provided a bunch of levels of abstraction so that once again they do not climb inside. Although at a certain stage it can be useful to understand what the author of the library wanted to say.

E
Eugene, 2020-06-08
@Nc_Soft

$request->all()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question