This is a really bad pattern. Instead move the logic to a common class like an action or a job and call that from both places
Sep 1, 2022
2
Level 1
Access Function of another contoller
I need to access function of another controller Controller 1
public function controller_1_function(){
$val = $this->Controller_2->controller_2_function();
}
Controller 2
public function controller_2_function(){
/*code*/
return;
}
But I am getting error Undefined property: "App\Http\Controllers\controller_1::$controller_2_function
Please or to participate in this conversation.