Explorar o código

Update AccountController, fix hydrateNotifications()

Notifications expect a collection, not a vanilla array.
Daniel Supernault %!s(int64=7) %!d(string=hai) anos
pai
achega
e37108c544
Modificáronse 2 ficheiros con 12 adicións e 2 borrados
  1. 2 2
      app/Http/Controllers/AccountController.php
  2. 10 0
      app/WebSub.php

+ 2 - 2
app/Http/Controllers/AccountController.php

@@ -38,9 +38,9 @@ class AccountController extends Controller
     public function hydrateNotifications($keys)
     {
       $prefix = 'notification.';
-      $notifications = [];
+      $notifications = collect([]);
       foreach($keys as $key) {
-        $notifications[] = Cache::get($prefix . $key);
+        $notifications->push(Cache::get("{$prefix}{$key}"));
       }
       return $notifications;
     }

+ 10 - 0
app/WebSub.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class WebSub extends Model
+{
+    //
+}