Skip to content
Advertisement

Laravel Redirect from Helper Class

I’m trying to redirect to an external URL from a helper class.

Here’s my controller:

JavaScript

Here’s my helper class used in the controller:

JavaScript

Why is the redirect() not working inside my_function()? Do I need to include some Laravel classes using the PHP “use” statement?

Advertisement

Answer

You can add send method and it will work.

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement