File: D:/HostingSpaces/SBogers96/smilefotografie.nl/app/controllers/BaseController.php
<?php
use Illuminate\Routing\Controller;
class BaseController extends Controller
{
public function emailAdministrator($exception, $code)
{
//Check if we exclude the email for the current url
if($this->checkExcludedErrors($code)) return false;
$mailer = \App::make('Komma\Mailers\Mailer');
$mailer->sendTo(\Config::get('business.admin_emails'), 'Fout Code ' . $code, 'emails/error',
[
'code' => $code,
'stack' => $exception->__toString(),
'path' => \Request::path()
]);
}
public function abortPage($type = 404)
{
$view = \View::make($type)->render();
return \Response::make($view, $type);
}
public function checkExcludedErrors($code){
if($code == 500) return false;
if(\Request::segment(1) == 'kms') return true;
if(\Request::segment(1) == 'autodiscover') return true;
if(\Request::segment(1) == 'browserconfig.xml') return true;
return false;
}
}