title: parsing data to javascript with laravel controller
body: <p>I send data with this code to JS:</p>
  <pre><code>$user = User::where('id' , $this-&gt;selectedItem)-&gt;first();
     
  $this-&gt;dispatchBrowserEvent('userModal', [
      'name' =&gt; $user-&gt;name,
      'signup' =&gt; jdate($user-&gt;created_at),
  ]);
  </code></pre>
  <p>‍‍<code>jDate()</code> Is a function to convert to Persian date</p>
  <p>but in frontend for <code>signup</code> I will receive a empty value
  and this is JS code to receive data :</p>
  <pre><code>window.addEventListener('userModal', event =&gt; {
      console.log(event.detail);
  });
  </code></pre>