Instead of defining all request processing logic in the form of a closure in a separate route, a controller can be used for integration. The controllers are stored in the app/http/controllers directory.
Define Controllers
The following is an example of a basic controller: