Assuming your long running function is server side, you are better off using a "pull" approach. Have some long polling code client side that sends a request to check the status of the job every few seconds and updates the client UI accordingly.
Obviously, the server needs to be able to report progress.
You could also use websockets but this is much more complex and probably overkill.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community