Don't show hidden items in RSS/Atom

This commit is contained in:
James Brooks 2015-06-12 08:56:17 +01:00
parent 884c43f160
commit 7888f5953b
2 changed files with 4 additions and 4 deletions

View File

@ -36,12 +36,12 @@ class AtomController extends AbstractController
if ($group->exists) {
$group->components->map(function ($component) use ($feed) {
$component->incidents()->orderBy('created_at', 'desc')->get()->map(function ($incident) use ($feed) {
$component->incidents()->visible()->orderBy('created_at', 'desc')->get()->map(function ($incident) use ($feed) {
$this->feedAddItem($feed, $incident);
});
});
} else {
Incident::orderBy('created_at', 'desc')->get()->map(function ($incident) use ($feed) {
Incident::visible()->orderBy('created_at', 'desc')->get()->map(function ($incident) use ($feed) {
$this->feedAddItem($feed, $incident);
});
}

View File

@ -36,12 +36,12 @@ class RssController extends AbstractController
if ($group->exists) {
$group->components->map(function ($component) use ($feed) {
$component->incidents()->orderBy('created_at', 'desc')->get()->map(function ($incident) use ($feed) {
$component->incidents()->visible()->orderBy('created_at', 'desc')->get()->map(function ($incident) use ($feed) {
$this->feedAddItem($feed, $incident);
});
});
} else {
Incident::orderBy('created_at', 'desc')->get()->map(function ($incident) use ($feed) {
Incident::visible()->orderBy('created_at', 'desc')->get()->map(function ($incident) use ($feed) {
$this->feedAddItem($feed, $incident);
});
}