make sure notification always returns array

This commit is contained in:
Denis Duliçi
2021-08-08 23:44:59 +03:00
parent 1921c3465d
commit d3233740b3
5 changed files with 57 additions and 47 deletions

View File

@ -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) {