File: D:/HostingSpaces/SBogers75/roost-interieurbouw.nl/app/Komma/Page/PageController.php
<?php
namespace Komma\Page;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Input;
use Komma\Mailers\ContactMailer;
use Komma\Mailers\FormValidationException;
use Komma\Mailers\Mailer;
class PageController extends Controller
{
public $data = [];
protected $pageService;
protected $mailer;
public function __construct(PageService $pageService, ContactMailer $mailer){;
$this->pageService = $pageService;
$this->mailer = $mailer;
}
public function index()
{
$this->data = array_merge($this->data, $this->pageService->loadContent());
$this->data = array_merge($this->data, $this->pageService->loadImages());
return \View::make('layouts.pages.page')->with('data', (object)$this->data);
}
public function disclaimer(){
$this->data = array_merge($this->data, $this->pageService->loadContent());
$this->data = array_merge($this->data, $this->pageService->loadDisclaimer());
$this->data = array_merge($this->data, $this->pageService->loadImages());
return \View::make('layouts.pages.onlyText')->with('data', (object)$this->data);
}
public function privacy(){
$this->data = array_merge($this->data, $this->pageService->loadContent());
$this->data = array_merge($this->data, $this->pageService->loadPrivacy());
$this->data = array_merge($this->data, $this->pageService->loadImages());
// dd($this->data);
return \View::make('layouts.pages.onlyText')->with('data', (object)$this->data);
}
public function mailed(){
try{
$inputs = Input::all();
$this->mailer->validate($inputs);
$this->mailer->sendForm($inputs);
$this->data = array_merge($this->data, $this->pageService->loadContent());
$this->data = array_merge($this->data, $this->pageService->loadImages());
$this->data['no_slider'] = true;
return \View::make('layouts.pages.thankYou')->with('data', (object)$this->data);
}
catch(FormValidationException $e)
{
return 'Vul alle verplichten velden in!';
}
}
public function av(){
$this->data = array_merge($this->data, $this->pageService->loadContent());
$this->data = array_merge($this->data, $this->pageService->loadAV());
$this->data = array_merge($this->data, $this->pageService->loadImages());
return \View::make('layouts.pages.onlyText')->with('data', (object)$this->data);
}
public function abort(){
$this->data = array_merge($this->data, $this->pageService->loadContent());
$this->data['no_slider'] = true;
$this->data = array_merge($this->data, $this->pageService->loadImages());
return \View::make('layouts.pages.404page')->with('data', (object)$this->data);
}
}