Skip to content

A free open source IT asset/license management system

Add necessary parts to invoke new 'background' queued mail provider

Brady Wetherington38cc06b62f1d
diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php
index 9856d29f71..1b4e260548 100644
--- a/app/Http/Kernel.php
+++ b/app/Http/Kernel.php
@@ -29,6 +29,7 @@ use Illuminate\Auth\Middleware\Authorize;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
+use Illuminate\Foundation\Http\Middleware\InvokeDeferredCallbacks;
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance;
use Illuminate\Http\Middleware\HandleCors;
use Illuminate\Routing\Middleware\SubstituteBindings;
@@ -59,6 +60,7 @@ class Kernel extends HttpKernel
SecurityHeaders::class,
PreventBackHistory::class,
HandleCors::class,
+ InvokeDeferredCallbacks::class,
];
diff --git a/app/Notifications/RequestAssetNotification.php b/app/Notifications/RequestAssetNotification.php
index 004f204bed..e598495b58 100644
--- a/app/Notifications/RequestAssetNotification.php
+++ b/app/Notifications/RequestAssetNotification.php
@@ -4,6 +4,7 @@ namespace App\Notifications;
use App\Helpers\Helper;
use App\Models\Setting;
+use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Messages\SlackMessage;
@@ -12,6 +13,7 @@ use Symfony\Component\Mime\Email;
class RequestAssetNotification extends Notification implements ShouldQueue
{
+ use Queueable;
public $target;
public $item;
diff --git a/config/app.php b/config/app.php
index dd3024277b..7f86672f9c 100755
--- a/config/app.php
+++ b/config/app.php
@@ -17,6 +17,7 @@ use Illuminate\Auth\Passwords\PasswordResetServiceProvider;
use Illuminate\Broadcasting\BroadcastServiceProvider;
use Illuminate\Bus\BusServiceProvider;
use Illuminate\Cache\CacheServiceProvider;
+use Illuminate\Concurrency\ConcurrencyServiceProvider;
use Illuminate\Cookie\CookieServiceProvider;
use Illuminate\Database\DatabaseServiceProvider;
use Illuminate\Database\Eloquent\Model;
@@ -466,6 +467,7 @@ return [
SnipeTranslationServiceProvider::class, // we REPLACE the default Laravel translator with our own
ValidationServiceProvider::class,
ViewServiceProvider::class,
+ ConcurrencyServiceProvider::class,
/*
* Package Service Providers...
diff --git a/config/queue.php b/config/queue.php
index 02f54c3c11..3bfc52a2b5 100644
--- a/config/queue.php
+++ b/config/queue.php
@@ -30,6 +30,10 @@ return [
'connections' => [
+ 'background' => [
+ 'driver' => 'background',
+ ],
+
'sync' => [
'driver' => 'sync',
],