new design
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
namespace App\Livewire;
|
||||
use App\Models\ContactEnquiry;
|
||||
use Livewire\Component;
|
||||
class ContactForm extends Component {
|
||||
public string $name = '';
|
||||
public string $email = '';
|
||||
public string $company = '';
|
||||
public string $service = '';
|
||||
public string $message = '';
|
||||
public string $website = '';
|
||||
public bool $submitted = false;
|
||||
public function submit(): void {
|
||||
$this->validate(['name'=>'required|string|max:120','email'=>'required|email|max:255','company'=>'nullable|string|max:120',
|
||||
'service'=>'nullable|string|max:100','message'=>'required|string|min:10|max:5000','website'=>'nullable|max:0']);
|
||||
ContactEnquiry::create($this->only(['name','email','company','service','message']));
|
||||
$this->reset(['name','email','company','service','message']);
|
||||
$this->submitted = true;
|
||||
}
|
||||
public function render() { return view('livewire.contact-form'); }
|
||||
}
|
||||
Reference in New Issue
Block a user