In this tutorial we're going to create our own Laravel package that will give you all the functionality you need to add a contact form to your website. The problem is if this contact form is open to the internet then you have to be careful about spam. Therefore in this package we're going to create the contact form using VueJS with a API to send the email.

The below code will create the contact form in VueJS and send the formData to the API route of the contact form using the https://github.com/axios/axios library.

This is everything you need to create a Contact Form Laravel package.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners