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