Search code examples
phplaraveloraclelaravel-8oracle10g

Is there ability to call database procedure from Laravel controller function?


I have code that do multi processes and it takes time to perform them and error timeout appear so I think to make the code inside database procedure and call it from controller function . is it a right solution or there is another technical solution ,please help me?

I have Setting more max_execution_time but I think its not a right solution .


Solution

  • You can use laravel terminable callback that will execute those after the response is sent to FE for example. Then fe must do subsequent request with 'is it ready yet?' like requests.

    PS. query times are not included into the php execution time limit.

    Or you can dispatch jobs instead of that terminable callback, but jobs have also a timeout.

    If you are trying to download something, then you can stream the response to fe (for csv for example, as xls is not posible because php excel lib does not support it, just excel js lib knows how to stream data from the browser's memory to disk).