mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-30 16:30:45 +00:00
Update NotificationService
This commit is contained in:
parent
251723ccc0
commit
519c05de32
1 changed files with 10 additions and 0 deletions
|
@ -79,6 +79,16 @@ class NotificationService {
|
||||||
$resource = new Fractal\Resource\Item($n, new NotificationTransformer());
|
$resource = new Fractal\Resource\Item($n, new NotificationTransformer());
|
||||||
return $fractal->createData($resource)->toArray();
|
return $fractal->createData($resource)->toArray();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function setNotification(Notification $notification)
|
||||||
|
{
|
||||||
|
return Cache::remember('service:notification:'.$notification->id, now()->addDays(7), function() use($notification) {
|
||||||
|
$fractal = new Fractal\Manager();
|
||||||
|
$fractal->setSerializer(new ArraySerializer());
|
||||||
|
$resource = new Fractal\Resource\Item($notification, new NotificationTransformer());
|
||||||
|
return $fractal->createData($resource)->toArray();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function warmCache($id, $stop = 100, $force = false)
|
public static function warmCache($id, $stop = 100, $force = false)
|
||||||
|
|
Loading…
Reference in a new issue