lundi 17 juin 2019

Call method of another controller in laravel

I have to call the method of another controller.

I use following code to make a call.

app('App\Http\Controllers\ApiUserController')->getList();

This is working fine.

But I want to try using use function so that I dont have to repeat all line

use App\Http\Controllers\ApiUserController;

class MyMethods
{
    public function index()
    {
        app('ApiUserController')->getList()

Did I made some mistake here?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire