I am maintaining some Laravel 6 code written by my colleges.
I find that they overrode the callAction method in controllers and initialise some variables in it. But I can't find the callAction method in Laravel 3-8 documentations.
What is the point of initialising variables within the callAction method instead of within the controller's constructor?
use Illuminate\Routing\Controller;
class ControllerA extends Controller
{
protected $data = [];
public function callAction($method, $parameters)
{
$this->data['title'] = 'Some database query';
}
public function index(Request $request)
{
return view('index', $this->data);
}
}