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;
}
}
}