vendredi 6 mars 2020

how to passing data to other function laravel 6

I am having trouble sending data in the form of ID from one function to another using laravel, here is my code but it doesn't work with an undefined variable error

 public function createPesanan()
{
   $survey->save();
   $id_survey = $survey->id;
   $this->listPesanan($id_survey);
   return redirect('user/list-pesanan')->with('status', 'Pesanan Survey Anda Berhasil di tambahkan');
}


  public function listPesanan()
    {
       $survey = Survey::find($id_survey);
       dd($survey);
    }


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire