I want to be able to call some functions defined in Controller Class, to any view. All controllers extends Controller class.
For example i want to call the function which is define in Controller class:
public function makeSeoLink($str)
{
// code logic....
return strtolower($str);
}
where HomeController extends it:
class HomeController extends Controller
{
return view('home.homepage');
{
in homepage view {{ makeSeoLink('asfasfs') }} or {{ $this->makeSeoLink('asfasfs') }} not working to call that function:
"Call to undefined function makeSeoLink()"
What i have done wrong?