Return, does not work in scheduled task?

1

I have a driver in Laravel, which is processed every so often by a task scheduled from the server.

This driver does a redirect:

  return redirect('/control_fich/'.$id_user.'/'.$date_utc);

To another controller that continues processing what is collected from a Soap. (This last data is a bit irrelevant).

The issue is that when I run this driver manually, using the API, I process it properly, but when ShellScript does it, it does not process the other driver.

It seems that return is not processed by ShellScript, how can I do to process the other driver?

    
asked by Miguel Herreros Cejas 19.03.2018 в 09:35
source

1 answer

1

This answer is not focused on ShellScript, because I do not use it, it is more focused on the design of the application:

In theory it is incorrect for a controller to "call" or redirect another controller, the controllers should not communicate with each other, for that there are as many layers or methods as:

  • Models
  • Repositories
  • Services
  • DI
  • Interfaces
  • Etcetera ...

In short, you should abstract a bit more what you are trying to do so that the two controllers can use it without having to call each other.

    
answered by 19.03.2018 / 15:14
source