mardi 9 mars 2021

Laravel 5.6 send data from OneController to SecondControoler store

I want to ask how I can send data from FirstController to SecondController in method: store? In my FirstController is method

public function senddata (Request $request)
{
   $content = new Request();
   $content -> any = anyVariable;
   return (new SecondController)->store($content);
}

In my SecondController is:

 public function store(Request $request)
    {
       $order = OrderDetail::create([
      'any' => 1,
       .....
       .....
        ]);
       ....
       return redirect()->route('orders.show',[$order->id]);
    }

If I send data directly via the form to SecondController it works. If I send data from FirstController to SecondController so me show laravel Error Get and Post data is empty.

How can i edit FirstController it to works? Thank you.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire