👁️‍🗨️

Controller

Controllers are the central part of the application
It is basically link the view and the models of the application model (MVC)
you can create a new controller by typing the following command in the terminal
php artisan make:controller UserController
 
notion image
Now you can make functions in the controller and use them as you want

Using controller

First we have to import the controller into web.php file
then you have to call controller as
Router::get("user",[UserController::class,'show']);
notion image

Param or data passing into controller

notion image
notion image