Complete the code to inject the service into the controller constructor.
public function __construct([1] $service) {
$this->service = $service;
}The constructor expects the service class to be injected. Here, UserService is the correct dependency.
Complete the method signature to inject the Request object.
public function store([1] $request) {
// method body
}The Request class is injected to access HTTP request data inside the method.
Fix the error in the controller method to correctly inject the service.
public function show([1] $userService, $id) { return $userService->find($id); }
The method expects the UserService to be injected so it can call the find method.
Fill both blanks to inject the service and call its method inside the controller.
public function update([1] $service, $id) { return $service->[2]($id); }
delete instead of update.The UserService is injected and its update method is called with the $id.
Fill all three blanks to inject the service, the request, and call the correct method.
public function store([1] $service, [2] $request) { return $service->[3]($request->all()); }
update instead of create.The UserService and Request are injected, and the create method is called with all request data.