mercredi 17 novembre 2021

How to call a Request function from a controller to another controller in Laravel

How to call a Request function from a controller to another controller in Laravel

Controller1.php

public function get(){

$call = new Controller2();

$input = new Request();
$input->param1 = param1;
$input->param2 = param2;

$response = $call->index($input)

}

Controller2.php

public function Index(Request $request){
dd($request->all());
}

I am getting [] as response.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire