HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers79/artofeinstein.be/app/Komma/Mailers/MailService.php
<?php


namespace Komma\Mailers;


use Illuminate\Support\Facades\Input;


class MailService extends Mailer
{

    public function offer($inputs){
        
        

        $this->makeRules(
            [
                'name'=> 'required',
                'email'=> 'required_without:phone|email',
                'phone'=> 'required_without:email',
            ]);

        $validated = $this->validate($inputs);

        if($validated && is_bool($validated))
        {
            $view = 'emails.contactForm';
            $to = \Config::get('mail.sendTo.address');
            $subject = 'Contactformulier Website';

            $this->sendTo($to, $subject, $view, $inputs);

            return 'true';
        }


        else{
            $error = [];

            if($validated->first('name')!=""){
                $error['name'] = $validated->first('name');
            }

            if($validated->first('email')!=""){
                $error['email'] = $validated->first('email');
            }

            return $error;
        }

    }
}