make sure notification always returns array
This commit is contained in:
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Http\ViewComposers;
|
||||
|
||||
use App\Utilities\Versions;
|
||||
use App\Traits\Modules;
|
||||
use App\Utilities\Versions;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class Header
|
||||
@ -71,16 +71,14 @@ class Header
|
||||
|
||||
$new_apps = $this->getNotifications('new-apps');
|
||||
|
||||
if ($new_apps) {
|
||||
foreach ($new_apps as $key => $new_app) {
|
||||
if (setting('notifications.' . user()->id . '.' . $new_app->alias)) {
|
||||
unset($new_apps[$key]);
|
||||
foreach ($new_apps as $key => $new_app) {
|
||||
if (setting('notifications.' . user()->id . '.' . $new_app->alias)) {
|
||||
unset($new_apps[$key]);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$notifications++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$notifications++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace App\Http\ViewComposers;
|
||||
|
||||
use App\Traits\Modules;
|
||||
use Route;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class Notifications
|
||||
@ -29,9 +29,7 @@ class Notifications
|
||||
|
||||
$path = str_replace('{company_id}/', '', $path);
|
||||
|
||||
if (!$notifications = $this->getNotifications($path)) {
|
||||
return;
|
||||
}
|
||||
$notifications = $this->getNotifications($path);
|
||||
|
||||
// Push to a stack
|
||||
foreach ($notifications as $notification) {
|
||||
|
Reference in New Issue
Block a user