How to print form data in laravel

Updated at 11-Apr-2021, By samar

How to print form data in laravel

In this article, we will see how to solve "How to print form data in laravel".

  • Print all input request form data in laravel

    --PATH app\Http\Controllers\<YourController>.php
    public function showFormData(Request $request){
        echo "<pre>";
        print_r($request->all());
        die;
    }
    

    You can use print_r($request->all()) method to print the form data in laravel. It will print all the submitted form input attributes and values in your controller file.

    Array
    (
        [_token] => YhHBEPub010Kl3ANNiXL6TX5uuAtNGcUiV8sIhgd
        [email] => [email protected]
        [name] => samar
    )

     

Back to code snippet queries related laravel