title: Use the return value of response->json response in the backend
body: <p>I am new to laravel 8 and I am working on an existing project.
  There is a function that returns a json response :</p>
  <pre><code>    public function ReturnTest($num) {
          return response()-&gt;json(array('test done succesfully',$num),200);
      }
  </code></pre>
  <p>and I want to use that returned array in the backend in this function :</p>
  <pre><code>    public function ViewPage() {
         /* $data = DB::select('select * from domaines');
          dd($data);*/
          $var=$this-&gt;ReturnTest(25);
          dd($var);
  
      }
  </code></pre>
  <pre><code>this is the result : 
  Illuminate\Http\JsonResponse {#290 ▼
    #data: &quot;[&quot;test done succesfully&quot;,25]&quot;
    #callback: null
    #encodingOptions: 0
    +headers: Symfony\Component\HttpFoundation\ResponseHeaderBag {#291 ▶}
    #content: &quot;[&quot;test done succesfully&quot;,25]&quot;
    #version: &quot;1.0&quot;
    #statusCode: 200
    #statusText: &quot;OK&quot;
    #charset: null
    +original: array:2 [▶]
    +exception: null
  }
  </code></pre>