Contact Form Component Laravel Livewire
Tech Stack: bootstrap-5, new, livewire
Demo
Let us hear from you directly!
Use this form to request a new component, submit your component ( provide github url ) or just say Hi !
Code
Download
Usage
@livewire('contact-component')
Documentation
This contact component lets users fill out the contact form and when the form is submitted it sends an email to the recipient along with all the contact information.
The Class component contains three fields to store the name, email, and contact message. Once the form is filled and submitted. Fields are validated using Livewire's inbuilt rules property.
Once validation succeeds, Mail::send
function is used to send an email to the admin.
ContactMail Mail class is used to send the email to the user.
This in turn sends the content of the blade file contact email which is in the emails directory
Contact from enquery from: {{ $contactName }}
Name: {{ $contactName }}
Email: {{ $contactEmail }}
Message: {{ $contactMessage }}
That's how easy it is to implement a contact component using Livewire.