Skip to content

Commit

Permalink
- upgrading laravel to 7.0
Browse files Browse the repository at this point in the history
- fix guideChimp tour
- cleanups
  • Loading branch information
v-rudkovskiy committed Apr 1, 2020
1 parent 5ebec5e commit 37db51e
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 114 deletions.
34 changes: 19 additions & 15 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

namespace App\Exceptions;

use Exception;
use Illuminate\Notifications\Messages\MailMessage;
use Throwable;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

Expand All @@ -25,37 +26,39 @@ class Handler extends ExceptionHandler
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $exception
* @param Throwable $exception
* @return void
*
* @throws \Exception
*/
public function report(Exception $exception)
public function report(Throwable $exception)
{
parent::report($exception);

//send error to developers emails
// send error to developers emails
$this->sendReport($exception);
}

/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
* @param \Illuminate\Http\Request $request
* @param \Throwable $exception
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Throwable
*/
public function render($request, Exception $exception)
public function render($request, Throwable $exception)
{
return parent::render($request, $exception);
}

/**
* Convert an authentication exception into an unauthenticated response.
* Convert an authentication exception into a response.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $exception
* @return \Illuminate\Http\Response
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $exception
* @return \Symfony\Component\HttpFoundation\Response
*/
protected function unauthenticated($request, AuthenticationException $exception)
{
Expand All @@ -71,7 +74,7 @@ protected function unauthenticated($request, AuthenticationException $exception)
*
* @param $exception
*/
protected function sendReport($exception)
protected function sendReport(Throwable $exception)
{
if (parent::shouldntReport($exception)) return;

Expand All @@ -82,6 +85,7 @@ protected function sendReport($exception)
$emails = is_string($emails) ? explode(',', $emails) : $emails;

\Mail::raw((string)$exception, function ($message) use ($exception, $emails) {
// TODO(RVA) need to check
$message->to($emails)->subject(config('app.name') . ' ' . config('app.env') . ' | Error ' . class_basename($exception));
});
}
Expand Down
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@
"require": {
"php": ">=7.2.5",
"albertcht/invisible-recaptcha": "^1.9",
"arcanedev/log-viewer": "^5.2.0",
"arcanedev/log-viewer": "^7.0",
"creativeorange/gravatar": "^1.0",
"davejamesmiller/laravel-breadcrumbs": "^5.2",
"fruitcake/laravel-cors": "^1.0",
"kyslik/column-sortable": "^6.1",
"labs64/netlicensingclient-php": "^2.4",
"laravel/framework": "^6.18.3",
"laravel/framework": "^7.0",
"laravel/socialite": "^4.1",
"laravel/tinker": "^2.0",
"laravel/ui": "^2.0",
"laravelcollective/html": "^6.1.0"
},
"require-dev": {
Expand All @@ -39,7 +41,7 @@
"filp/whoops": "^2.3",
"fzaninotto/faker": "^1.8",
"mockery/mockery": "^1.3.1",
"phpunit/phpunit": "^8.1",
"phpunit/phpunit": "^8.5",
"spatie/phpunit-watcher": "^1.12"
},
"autoload": {
Expand Down
34 changes: 34 additions & 0 deletions config/cors.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Cross-Origin Resource Sharing (CORS) Configuration
|--------------------------------------------------------------------------
|
| Here you may configure your settings for cross-origin resource sharing
| or "CORS". This determines what cross-origin operations may execute
| in web browsers. You are free to adjust these settings as needed.
|
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
*/

'paths' => ['api/*'],

'allowed_methods' => ['*'],

'allowed_origins' => ['*'],

'allowed_origins_patterns' => [],

'allowed_headers' => ['*'],

'exposed_headers' => [],

'max_age' => 0,

'supports_credentials' => false,

];
111 changes: 44 additions & 67 deletions config/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,63 @@

/*
|--------------------------------------------------------------------------
| Mail Driver
| Default Mailer
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses",
| "sparkpost", "log", "array"
| This option controls the default mailer that is used to send any email
| messages sent by your application. Alternative mailers may be setup
| and used as needed; however, this mailer will be used by default.
|
*/

'driver' => env('MAIL_DRIVER', 'smtp'),
'default' => env('MAIL_MAILER', 'smtp'),

/*
|--------------------------------------------------------------------------
| SMTP Host Address
| Mailer Configurations
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Mailgun mail service which will provide reliable deliveries.
| Here you may configure all of the mailers used by your application plus
| their respective settings. Several examples have been configured for
| you and you are free to add your own as your application requires.
|
*/

'host' => env('MAIL_HOST', 'mailhog'),

/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
| Laravel supports a variety of mail "transport" drivers to be used while
| sending an e-mail. You will specify which one you are using for your
| mailers below. You are free to add additional mailers as required.
|
| This is the SMTP port used by your application to deliver e-mails to
| users of the application. Like the host we have set this value to
| stay compatible with the Mailgun e-mail application by default.
| Supported: "smtp", "sendmail", "mailgun", "ses",
| "postmark", "log", "array"
|
*/

'port' => env('MAIL_PORT', 1025),
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
],

'ses' => [
'transport' => 'ses',
],

'sendmail' => [
'transport' => 'sendmail',
'path' => '/usr/sbin/sendmail -bs',
],

'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
],

'array' => [
'transport' => 'array',
],
],

/*
|--------------------------------------------------------------------------
Expand All @@ -56,51 +74,10 @@
*/

'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'laravel-boilerplate@local.local'),
'name' => env('MAIL_FROM_NAME', 'Laravel Boilerplate'),
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],

/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/

'encryption' => env('MAIL_ENCRYPTION', ''),

/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/

'username' => env('MAIL_USERNAME'),

'password' => env('MAIL_PASSWORD'),

/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/

'sendmail' => '/usr/sbin/sendmail -bs',

/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
Expand Down
3 changes: 1 addition & 2 deletions config/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
|
*/

'secure' => env('SESSION_SECURE_COOKIE', false),
'secure' => env('SESSION_SECURE_COOKIE', null),

/*
|--------------------------------------------------------------------------
Expand All @@ -175,5 +175,4 @@
*/

'http_only' => true,

];
31 changes: 4 additions & 27 deletions resources/assets/admin/js/admin.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
(function($){
var guidedTourData = localStorage.getItem('guidedTourData')
? JSON.parse(localStorage.getItem('guidedTourData'))
: { isStarted: false, currentStep: 0 };
// enable plugins
GuideChimp.extend(guideChimpPluginMultiPage);

var guideChimp = new GuideChimp();
/*
guideChimp.on('onBeforeChange', function (tour, to, from) {
if (from.page && window.location.href.indexOf(from.page) < 0) {
guidedTourData.currentStep = tour.steps.indexOf(from);
guidedTourData.isStarted = true;
localStorage.setItem('guidedTourData', JSON.stringify(guidedTourData));
window.location.href = from.page;
}
});
*/
guideChimp.on('onStop', function () {
guidedTourData.currentStep = 0;
guidedTourData.isStarted = false;
localStorage.setItem('guidedTourData', JSON.stringify(guidedTourData));
});

guideChimp.setTour([
var guide = GuideChimp([
{
element: '.guide',
title: 'Start Guided Tour',
Expand All @@ -36,14 +18,9 @@
title: 'Log Levels',
description: 'This is a component, which is providing you with information about application logs.',
},

]);

if (guidedTourData.isStarted) {
guideChimp.start(guidedTourData.currentStep, true);
}

$('.guided-tour').on('click', function(){
guideChimp.start();
guide.start();
});
})(jQuery);
1 change: 1 addition & 0 deletions webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ mix.scripts([
'node_modules/gentelella/vendors/bootstrap-progressbar/bootstrap-progressbar.min.js',
'node_modules/gentelella/build/js/custom.js',
'node_modules/guidechimp/dist/guidechimp.min.js',
'node_modules/guidechimp/dist/plugins/multiPage.min.js',
'resources/assets/admin/js/admin.js',
], 'public/assets/admin/js/admin.js').version();

Expand Down

0 comments on commit 37db51e

Please sign in to comment.