Laravel Call Controller Method From Another Method Example

Admin   Laravel   186  2021-03-15 15:10:06

Hi Guys

In this blog,I will example you how to call controller method from another method in laravel. I will show example of laravel call controller method from another method.you can easliy call controller method from another method in laravel.

I will describe step by step laravel call controller method from another method example.

Step 1: Create Route

In this setp,I will create route for a call controller method from another method

in laravel.

 

Route::get('/home', '[email protected]')->name('home');

Step 2: Create Controller

In this setp, I will create two controller using terminal/cmd. I will create UserController and AdminController.

 

php artisan make:UserController

and

 

php artisan make:AdminController

Step 3:User Controller

In this setp, i will writer code of call controller method from another method.