title: How to send data from controller blade to component livewire
body: <p>People who know LIVEWIRE-LARAVEL ‼ I need to get some code working on livewire ( form update )
  I'm trying to pass data (products)
  :From controller ( layout content )
  To a livewire component (product-update)</p>
  <p>But it doesn't work, sometimes it doesn't recognize &quot;$products&quot; sometimes it sends forms doesn't work from livewire component</p>
  <p>So what is good practice? To retrieve product data and make form update work from livewire</p>
  <p>Thanks in advance</p>
  <p>controller that call livewire component (as suugested by KeyvanGholami):</p>
  <pre><code>public function editProduit($idsscatg, $idprd){
  
      $ss_catg = SousCategorie::find($idsscatg);
  
      $idsscatgg = $idsscatg;
      $idprdd = $idprd;
  
      $nom_catg = $ss_catg-&gt;nom_catg;
  
      if( $ss_catg-&gt;nom_catg == 'Consommable médico-chirurgical')
      {
          $produit = ProduitConsommable::find($idprdd);
          
          return view('livewire.update-produit',compact('produit', 'idsscatgg', 'nom_catg'));
  
      }
  </code></pre>
  <p>my component (update-produit) inorder to test the submiting for,
  BUT THE FORM DOENS'T SUBMIT !!! it reload and return back the form with the token in url:</p>
  <pre><code>@extends('Admin.layoutAdmin')
  @section('content')
  {{-- &lt;livewire:update-produit :produits=&quot;$produits&quot;)&gt; --}}
  &lt;div&gt;
      &lt;div class=&quot;container-fluid mb-5&quot;&gt;
          &lt;div class=&quot;row mb-4&quot;&gt;
              &lt;div class=&quot;col-lg-10&quot;&gt;
                  &lt;h3&gt; Modifier Produit &lt;/h3&gt;
              &lt;/div&gt;   
          &lt;/div&gt;
          &lt;div class=&quot;container&quot;&gt;
              &lt;form class=&quot;contact-form row&quot; wire:submit.prevent=&quot;oui&quot; enctype = &quot;multipart/form-data&quot;&gt;                       
                  @csrf
                  &lt;input type=&quot;text&quot; wire:model=&quot;oui&quot;&gt;
                  &lt;div class=&quot;container-fluid d-flex align-items-center justify-content-center&quot; &gt;                         
                      &lt;button wire:click=&quot;submit&quot; type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;Enregistrer&lt;/button&gt;
  
                  &lt;/div&gt;
              &lt;/form&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>livewire function pour test form submit:</p>
  <pre><code>public function mount(){
  
          $cons = SousCategorie::where('nom_catg', 'Consommable médico-chirurgical')-&gt;get();
          $equips = SousCategorie::where('nom_catg', 'Equipements')-&gt;get();
          $mobs = SousCategorie::where('nom_catg', 'Mobilier médical')-&gt;get();
          $landangers = SousCategorie::where('nom_catg', 'Landanger')-&gt;get();
          $delacroixs = SousCategorie::where('nom_catg', 'Delacroix-chevalier')-&gt;get();
          $divs = SousCategorie::where('nom_catg', 'Divers')-&gt;get();
  
                   
          View::share('cons', $cons);
          View::share('equips', $equips);
          View::share('mobs', $mobs);
          View::share('landangers', $landangers);
          View::share('delacroixs', $delacroixs);
          View::share('divs', $divs);
  
      }
      public function render($produits)
      {
          return view('livewire.update-produit');   
      }
  
  
      public function oui(){
  
          $oui = $this-&gt;oui;
          dd($oui);
  
      }
  </code></pre>
  <p>Help me please !</p>