Path : /var/www/html/phkaymedia/app/Http/Livewire/Frontend/ |
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
Current File : /var/www/html/phkaymedia/app/Http/Livewire/Frontend/ContactUsPage.php |
<?php namespace App\Http\Livewire\Frontend; use Telegram\Bot\Api; use App\Models\Contact; use Livewire\Component; use Jantinnerezo\LivewireAlert\LivewireAlert; class ContactUsPage extends Component { use LivewireAlert; public $name, $email, $subject, $description; protected $rules = [ 'name' => 'required', 'email' => 'required|email', 'subject' => 'required', 'description' => 'required|min:15' ]; public function render() { return view('livewire.frontend.contact-us-page'); } public function updated($propertyName) { $this->validateOnly($propertyName); } public function send() { $this->validate([ 'name' => 'required', 'email' => 'required|email', 'subject' => 'required', 'description' => 'required|min:15' ]); Contact::create([ 'name' => $this->name, 'email' => $this->email, 'subject' => $this->subject, 'description' => $this->description ]); $tel = new Api(env('TELEGRAM_BOT_TOKEN')); $tel->sendMessage([ 'chat_id' => env('TELEGRAM_CHAT_ID'), 'parse_mode' => 'HTML', 'text' => 'New Contact Message from Phkay Media website: <i>Name</i>: <strong>'. $this->name.'</strong> <i>Email</i>: <strong>'. $this->email.'</strong> <i>Subject</i>: <strong>'. $this->subject.'</strong> <i>Description</i>: '. $this->description ]); $this->reset(); $this->alert('success', 'Coming soon!!!', [ 'position' => 'center', 'icon' => 'success', 'showConfirmButton' => false, 'timerProgressBar' => true, 'timer' => 3000 ]); } }