Calling other function in the same controller?

You can call the method with $this->methodNameYouWantToCall($thing_you_want_to_pass).

In Your case you can something like this......

return $this->sendRequest($uri);

Yes. Problem is in wrong notation. Use:

$this->sendRequest($uri)

Instead. Or

self::staticMethod()

for static methods. Also read this for getting idea of OOP - http://www.php.net/manual/en/language.oop5.basic.php


Try:

return $this->sendRequest($uri);

Since PHP is not a pure object-oriented language, it interprets sendRequest() as an attempt to invoke a globally defined function (just like nl2br() for example), but since your function is part of a class (InstagramController), you need to use $this to point the interpreter in the right direction.

Tags:

Php

Laravel