I need to find know how to properly use the dd()
function in Laravel projects.
For example - I have got tasks to debug some code and functionality in my project (PHP /Laravel) and it always takes me forever to find the exact file or folder or code where the problem is.
My mentor says to use dd()
functiom to find things faster (but for learning purposes he didn't explain me a lot about how to actually use it and said to find out myself), but said that I should start with Route (we use backpack as well for our project). So after finding Route (custom.php file) which controller connects to my required route what should I do next?
How do I implement the dd()
function (or as my mentor says dd('call here')
function) to quickly find what I should be looking for to solve my problem and complete my task?
Where should I write this dd()
and how should I write it?
For example, I have:
public function create(): View
{
return view('xxxxxx. \[
//
//
\]);
}
and if I put dd()
anywhere in the code, I get error message in my URL.
dd()
called inside of a loop makes NO sense, right? https://mcmap.net/q/1323910/-script-execution-foreach-loop-stops-when-i-call-laravel-39-s-dd-function-duplicate/2943403 – Perugia