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

boghy933's avatar

Best way to embed form

Hello,

I have the following setup:

  1. Laravel API
  2. Website made with VUE that uses the API - The main functionality is a form that can create a booking request.

Now i need to embed on multiple websites the module.

Which is the best way to do this considering that some steps of the module should change?

I was thinking at 2 main solutions:

  1. Find a way to embed the actual module.
  2. Create in Laravel some blade views with partial view.

Did you guys have any other suggestion? Thank you.

0 likes
2 replies
automica's avatar
automica
Best Answer
Level 54

@boghy933 I would create a separate vue component for the form and then you can use this component on the various websites that need the form.

if some of the functionality changes between sites, make these changes reliant on configuration and you can put this configuration in a .env that will be read in by your vue app when it is compiled into your assets, or you can include it as js variables and read them at run time.

you should also set up CORS for your laravel api so it can only be hit by requests from your vue form, and that will prevent any unsolicited traffic overloading your api.

1 like

Please or to participate in this conversation.