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/SBogers26/gripp.nu/app/Komma/Mailers/MailService.php
<?php


namespace Komma\Mailers;


use Illuminate\Support\Facades\Input;


class MailService extends Mailer
{

    public function offer($inputs){

        $this->makeRules(
            [
                'contactName'=> 'required',
                'emailForm'=> 'required|email',
                'formMessage'=> 'required',
            ]);

        $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('contactName')!=""){
                $error['contactName'] = $validated->first('contactName');
            }

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

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

            return $error;
        }

    }
}