-1

Following is my code of the controller. I'm calling this controller, but still unable to do any console. Am I doing anything wrong here? I just want to observe values in console, functionality is working fine.

public function registerValidation(Request $request)
    {
        dd("request 2");
        var_dump("request 2");
        dump("request 2");
        dd($request);
        var_dump($request);
        dump($request);
        die("here");
        $this->validate(
            $request,
            [
                'password' => 'required|string|min:6|confirmed',
                'password_confirmation' => 'required',
                'termsconditions' => 'required',
            ]
        );
    }
8
  • What console are you talking about, the browser's Javascript Console? Or the "terminal"/CLI? Commented May 13, 2020 at 8:54
  • @kerbholz I'm talking about browser Javascript console. Commented May 13, 2020 at 9:05
  • Why would you expect a server-side, non-javascript code to output anything to the client's js console? Commented May 13, 2020 at 9:06
  • @kerbholz from where can I see these logs then? Commented May 13, 2020 at 9:07
  • 2
    laravel.com/docs/5.8/logging Good luck Commented May 13, 2020 at 9:15

1 Answer 1

1

dd is short for dump and die, and will stop execution of your code.

You're probably looking for var_dump() if you're running your code in console, or error_log() if you're using your site in a browser, and watching the logs (with something like tail -f /var/log/apache2/error.log).

Sign up to request clarification or add additional context in comments.

2 Comments

var_dump() & error_log() are also not working and not giving any value in the console
error_log() logs errors to the error logs. Are you watching the error logs, or are you looking at stdout in a terminal?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.