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.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3oEh7Ja
via IFTTT

Aucun commentaire:

Enregistrer un commentaire