Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

patgilmour's avatar

Embed Laravel App/Component in External Website

Hi - I'm wondering if anyone could give me pointers on how best to integrate my Laravel app into other front end websites.

In short I want to show a user who has just submitted a PDF through a form on an external website what is happening with the PDF (we analyse and report on quality) on my Laravel website.

The steps I have working to date are something like this:

Vanilla Website form/PDF submit <--> Laravel Website <--> PDF Analysis/Reporting tool.
  • The user submits the form/PDF to a PHP (or other) script.
  • cURL sends the id/URL of PDF to Laravel before redirecting the user's browser to the Laravel site. On the Laravel site, the user can watch (via Broadcasting/Pusher) the download, analysis and reporting of the PDF analysis (it happens on another app that sends http update requests to Laravel).
  • When complete, the user clicks a button and is redirected back to their originating website.

The advantage of the above it is relatively easy to write some vanilla PHP for the user website to get the id and URL across to Laravel and to redirect the browser. The disadvantage is they are redirected out of their site and back into it. Not seamless and if I do this for, say, five clients, I'm going to have to create five views to appromiately match the brand of the originalting site.

10 years ago, I might have kluged something with an iFrame so the user wouldn't have to leave their site.

Today, I'm not sure how to proceed. Do I stick with redirects? Or is there a better way? I've just started tinkering with Vue (I use it with Laravel Echo for the progress bars on the above). Is there some way to achieve something similar to an iFrame with a relatively portable view componont that the website owner could easily embed in the code of their site?

Thanks for any insights anyone can offer!

0 likes
2 replies
aurawindsurfing's avatar

Hey @patgilmour

It looks like you are still trying to redirect a user away from a website where he originally uploaded the file. That might not be a good idea IMHO. If you would still like to do that tough then you simply create an endpoint within your laravel application that will receive user file_url where_to_redirect_backand so on. Then you do what you have to do in your laravel app and redirect him back. It is doable.

Second option would be to handle everything on the original website and use VueJS as you suggested to call API of your laravel app and process the files that way.

Hope it helps!

patgilmour's avatar

Thanks @aurawindsurfing - useful, and just what I was considering. Neither are great choices, admittedly, but at least it can be done.

Please or to participate in this conversation.