addDays(7), function() use($id, $publicOnly) { if($publicOnly) { $status = Status::whereScope('public')->find($id); } else { $status = Status::whereIn('scope', ['public', 'private', 'unlisted', 'group'])->find($id); } if(!$status) { return null; } $fractal = new Fractal\Manager(); $fractal->setSerializer(new ArraySerializer()); $resource = new Fractal\Resource\Item($status, new StatusStatelessTransformer()); return $fractal->createData($resource)->toArray(); }); } public static function getFull($id, $pid, $publicOnly = true) { $res = self::get($id, $publicOnly); $res['relationship'] = RelationshipService::get($pid, $res['account']['id']); return $res; } public static function getDirectMessage($id) { $status = Status::whereScope('direct')->find($id); if(!$status) { return null; } $fractal = new Fractal\Manager(); $fractal->setSerializer(new ArraySerializer()); $resource = new Fractal\Resource\Item($status, new StatusTransformer()); return $fractal->createData($resource)->toArray(); } public static function del($id) { $status = self::get($id); if($status && isset($status['account']) && isset($status['account']['id'])) { Cache::forget('profile:embed:' . $status['account']['id']); } Cache::forget('status:transformer:media:attachments:' . $id); MediaService::del($id); Cache::forget('status:thumb:nsfw0' . $id); Cache::forget('status:thumb:nsfw1' . $id); Cache::forget('pf:services:sh:id:' . $id); PublicTimelineService::rem($id); Cache::forget(self::key($id, false)); return Cache::forget(self::key($id)); } public static function refresh($id) { Cache::forget(self::key($id, false)); Cache::forget(self::key($id, true)); self::get($id, false); self::get($id, true); } }