I purchased a html template is just for front-end ? just like https://adminlte.io/themes/AdminLTE/index2.html ?
the php file is write by yourself ?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I purchased a html template from themeforest and I'm in the process of converting all the files into blade files. Bit of a mission I must say.
I now need to setup my contact form. I'm quite lost at the moment. I did read through the Laravel mail docs but I'm struggling. So the theme included the contact form (in html obviously) as well as the php 'contact-process file. Both files are shown below.
My question is, how do I convert this to laravel? I'm not sure which steps to follow. How can I make this contact form work in laravel?
The Form:
<form method="post" id="contact-form" action='contact-process.php'>
<label>Name</label>
<p><input type="text" name="name" class="reservation-fields" /></p>
<label>Email</label>
<p><input type="text" name="email" class="reservation-fields"/></p>
<label>Subject</label>
<p><input type="text" name="subject" class="reservation-fields" /></p>
<label>Message</label>
<p> <textarea name="message" id="msg-contact" class="reservation-fields" rows="7"></textarea></p>
<p class="antispam">Leave this empty: <input type="text" name="url" /></p>
<p class="contact-btn"><input type="submit" value="Send message" id="submit"/></p>
</form>
PHP File:
<?php
$recipient = "[email protected]";
$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];
if (isset($_POST['email'])) {
if (preg_match('(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,})', $_POST['email'])) {
$msg = 'E-mail address is valid';
} else {
$msg = 'Invalid email address';
}
$ip = getenv('REMOTE_ADDR');
$host = gethostbyaddr($ip);
$mess = "Name: ".$name."\n";
$mess .= "Email: ".$email."\n";
$mess .= "Subject: ".$subject."\n";
$mess .= "Message: ".$message."\n\n";
$mess .= "IP:".$ip." HOST: ".$host."\n";
$headers = "From: <".$email.">\r\n";
if(isset($_POST['url']) && $_POST['url'] == ''){
$sent = mail($recipient, $subject, $mess, $headers);
}
} else {
die('Invalid entry!');
}
This doesn't seem too difficult. How familiar are you with laravel? I mean, do you know how to make forms/controllers/views/routes/validation, etc?
In short,
action to point to that route{{ csrf_field() }}
Please or to participate in this conversation.