How I am supposed to return the view in the controller? #142
-
Hello there, Enlightn gives me a reliability warning like this: "Method App\Http\Controllers\BookController::index() should return Illuminate\Http\Response but returns Illuminate\View\View." |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I think you need to just fix the docblock and add View as a return type hint |
Beta Was this translation helpful? Give feedback.
-
All you need to do is make the method look like this where you return the view as a response. |
Beta Was this translation helpful? Give feedback.
All you need to do is make the method look like this where you return the view as a response.
Add this line of code before your method:
* @return \Illuminate\View\View