Controllers are containers for methods that contain application logic related to a common domain.
Creating a Controller
Open the command prompt and type the following command to create a controller using the Artisan CLI (Command Line Interface).
php artisan make:controller <controller-name> --plain
You can provide <controller-name> with your own. This will create a plain constructor as we are passing the argument — plain. If you don’t want to create a plain constructor, you can simply ignore the argument. The created constructor can be seen at the following directory:
Here you will see some of the codings is already done. You can call the already created controller by the following command:
Route::get(‘base URI’,’[email protected]’);