validation-bugsnag-email
This commit is contained in:
@@ -41,21 +41,7 @@ class Handler extends ExceptionHandler
|
||||
*/
|
||||
public function report(\Throwable $e)
|
||||
{
|
||||
dd($e);
|
||||
Bugsnag::setBeforeNotifyFunction(function ($error) { //set bugsnag
|
||||
return false;
|
||||
});
|
||||
// check if system is running in production environment
|
||||
if (\App::environment() == 'production') {
|
||||
$debug = Config::get('app.bugsnag_reporting'); //get bugsang reporting preference
|
||||
if ($debug) { //if preference is true for reporting
|
||||
$version = Config::get('app.version'); //set app version in report
|
||||
Bugsnag::setAppVersion($version);
|
||||
Bugsnag::setBeforeNotifyFunction(function ($error) { //set bugsnag
|
||||
return true;
|
||||
}); //set bugsnag reporting as true
|
||||
}
|
||||
}
|
||||
$this->reportToBugsNag($e);
|
||||
|
||||
return parent::report($e);
|
||||
}
|
||||
@@ -229,4 +215,22 @@ class Handler extends ExceptionHandler
|
||||
|
||||
return parent::render($request, $e);
|
||||
}
|
||||
|
||||
protected function reportToBugsNag(\Throwable $e)
|
||||
{
|
||||
if (Config::get('app.bugsnag_reporting') && env('APP_ENV') == 'production' && $this->shouldReportBugsnag($e)) {
|
||||
Bugsnag::notifyException($e);
|
||||
}
|
||||
}
|
||||
|
||||
public function shouldReportBugsnag($e)
|
||||
{
|
||||
foreach ($this->dontReport as $report) {
|
||||
if ($e instanceof $report) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -8,5 +8,5 @@ Breadcrumbs::register('logs', function ($breadcrumbs) {
|
||||
$breadcrumbs->push('System Logs', route('logs'));
|
||||
});
|
||||
Route::middleware('web', 'auth', 'roles')->group(function () {
|
||||
Route::get('logs', [App\FaveoLog\controllers\LogViewerController::class, 'index'])->name('logs');
|
||||
Route::get('logs', [\App\FaveoLog\controllers\LogViewerController::class, 'index'])->name('logs');
|
||||
});
|
||||
|
@@ -93,7 +93,7 @@ class AgentController extends Controller
|
||||
// returns to the page with all the variables and their datas
|
||||
$send_otp = DB::table('common_settings')->select('status')->where('option_name', '=', 'send_otp')->first();
|
||||
|
||||
return view('themes.default1.admin.helpdesk.agent.agents.create', compact('assign', 'teams', 'agents', 'timezones', 'groups', 'departments', 'team', 'send_otp'))->with('phonecode', $phonecode->phonecode);
|
||||
return view('themes.default1.admin.helpdesk.agent.agents.create', compact('teams', 'timezones', 'groups', 'departments', 'team', 'send_otp'))->with('phonecode', $phonecode->phonecode);
|
||||
} catch (Exception $e) {
|
||||
// returns if try fails with exception meaagse
|
||||
return redirect()->back()->with('fails', $e->getMessage());
|
||||
@@ -111,6 +111,9 @@ class AgentController extends Controller
|
||||
*/
|
||||
public function store(User $user, AgentRequest $request)
|
||||
{
|
||||
if ($request->fails()) {
|
||||
return redirect('agents/create');
|
||||
}
|
||||
if ($request->get('country_code') == '' && ($request->get('phone_number') != '' || $request->get('mobile') != '')) {
|
||||
return redirect()->back()->with(['fails2' => Lang::get('lang.country-code-required-error'), 'country_code' => 1])->withInput();
|
||||
} else {
|
||||
@@ -195,7 +198,7 @@ class AgentController extends Controller
|
||||
$teams = $team->pluck('id', 'name')->toArray();
|
||||
$assign = $team_assign_agent->where('agent_id', $id)->pluck('team_id')->toArray();
|
||||
|
||||
return view('themes.default1.admin.helpdesk.agent.agents.edit', compact('teams', 'assign', 'table', 'teams1', 'selectedTeams', 'user', 'timezones', 'groups', 'departments', 'team', 'exp', 'counted'))->with('phonecode', $phonecode->phonecode);
|
||||
return view('themes.default1.admin.helpdesk.agent.agents.edit', compact('teams', 'assign', 'table', 'teams1', 'user', 'timezones', 'groups', 'departments', 'team', 'exp', 'counted'))->with('phonecode', $phonecode->phonecode);
|
||||
} catch (Exception $e) {
|
||||
return redirect('agents')->with('fail', Lang::get('lang.failed_to_edit_agent'));
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@ use App\Model\helpdesk\Utility\MailboxProtocol;
|
||||
use Crypt;
|
||||
use Exception;
|
||||
use Lang;
|
||||
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
|
||||
|
||||
/**
|
||||
* ======================================
|
||||
@@ -124,6 +125,7 @@ class EmailsController extends Controller
|
||||
|
||||
return $this->validateEmailError($send, $fetch);
|
||||
} catch (Exception $ex) {
|
||||
dd($ex->getMessage());
|
||||
$message = $ex->getMessage();
|
||||
if ($request->input('fetching_status') && imap_last_error()) {
|
||||
$message = imap_last_error();
|
||||
@@ -253,11 +255,10 @@ class EmailsController extends Controller
|
||||
|
||||
$this->emailService($driver, $service_request);
|
||||
$this->setMailConfig($driver, $address, $name, $username, $password, $enc, $host, $port);
|
||||
$transport = (new \Swift_SmtpTransport($host, $port, $enc));
|
||||
$transport = new EsmtpTransport($host, $port);
|
||||
$transport->setUsername($username);
|
||||
$transport->setPassword($password);
|
||||
$mailer = (new \Swift_Mailer($transport));
|
||||
$mailer->getTransport()->start();
|
||||
$transport->start();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@@ -220,7 +220,7 @@ class TeamController extends Controller
|
||||
// dd($a_id);
|
||||
$user = $user->whereIn('id', $a_id)->where('active', '=', 1)->orderBy('first_name')->get();
|
||||
// dd($user);
|
||||
return view('themes.default1.admin.helpdesk.agent.teams.edit', compact('agent_id', 'user', 'teams', 'allagents'));
|
||||
return view('themes.default1.admin.helpdesk.agent.teams.edit', compact('agent_id', 'user', 'teams'));
|
||||
} catch (Exception $e) {
|
||||
return redirect()->back()->with('fails', $e->getMessage());
|
||||
}
|
||||
|
@@ -151,7 +151,7 @@ class UserController extends Controller
|
||||
}
|
||||
// displaying list of users with chumper datatables
|
||||
// return \Datatable::collection(User::where('role', "!=", "admin")->get())
|
||||
return \Datatables::of($users)
|
||||
return \Yajra\DataTables\Facades\DataTables::of($users)
|
||||
/* column username */
|
||||
->removeColumn('id', 'last_name', 'country_code', 'phone_number')
|
||||
->addColumn('user_name', function ($model) {
|
||||
|
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers\Common;
|
||||
|
||||
use Exception;
|
||||
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
|
||||
|
||||
class CommonMailer
|
||||
{
|
||||
@@ -12,17 +13,12 @@ class CommonMailer
|
||||
if (!$config) {
|
||||
return false;
|
||||
}
|
||||
$https = [];
|
||||
$https['ssl']['verify_peer'] = false;
|
||||
$https['ssl']['verify_peer_name'] = false;
|
||||
$transport = new \Swift_SmtpTransport($config['host'], $config['port'], $config['security']);
|
||||
$transport = new EsmtpTransport($config['host'], $config['port']);
|
||||
$transport->setUsername($config['username']);
|
||||
$transport->setPassword($config['password']);
|
||||
$transport->setStreamOptions($https);
|
||||
$set = new \Swift_Mailer($transport);
|
||||
|
||||
// Set the mailer
|
||||
\Mail::setSymfonyTransport($set);
|
||||
\Mail::setSymfonyTransport($transport);
|
||||
|
||||
return true;
|
||||
} catch (Exception $e) {
|
||||
|
@@ -4,6 +4,7 @@ namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use App\Model\helpdesk\Settings\CommonSettings;
|
||||
use Illuminate\Contracts\Validation\Validator;
|
||||
|
||||
/**
|
||||
* AgentRequest.
|
||||
|
@@ -126,7 +126,7 @@ function isInstall()
|
||||
{
|
||||
$check = false;
|
||||
$env = base_path('.env');
|
||||
if (\File::exists($env) && \Config::get('database.install') == 1) {
|
||||
if (\File::exists($env) && env('DB_INSTALL') == 1) {
|
||||
$check = true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user