laravel: How to call controller function from a component

257 Views Asked by At

I have a rss feed (world news) section in sidebar of page. That sidebar will be visible in all pages.

Hence I thought to make component of sidebar since it is for all page. But rss feed I am using willvincent/feeds calls feed via function from controller.

It is working fine until I call it from view. But when I switch to component then it is showing undefined variable (var in foreach).

Is there a way to use controller function directly in component? Or is there any other work around?

0

There are 0 best solutions below