public function index(Request $request) { $entries = (new ReportService()) ->setYear(2020) ->getTransactionReport($request->input('project')); // ... Other code