Basic Controllers
Here is an example of a basic controller class. All Laravel controllers should extend the base controller class included with the default Laravel installation:
We can route to the controller action like so:
Now, when a request matches the specified route URI, the showProfile method on the UserController class will be executed. Of course, the route parameters will also be passed to the method