-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #256 from Kovah/dev
Release
- Loading branch information
Showing
48 changed files
with
1,517 additions
and
1,098 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\App; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Models\Link; | ||
use App\Models\LinkList; | ||
use App\Models\Tag; | ||
use Illuminate\Http\Request; | ||
use Illuminate\Http\Response; | ||
|
||
class FeedController extends Controller | ||
{ | ||
public function links(Request $request): Response | ||
{ | ||
$links = Link::latest()->with('user')->get(); | ||
$meta = [ | ||
'title' => 'LinkAce Links', | ||
'link' => $request->fullUrl(), | ||
'updated' => now()->toRfc3339String(), | ||
'id' => $request->fullUrl(), | ||
]; | ||
|
||
return new Response(view('actions.feed.links', [ | ||
'meta' => $meta, | ||
'links' => $links, | ||
]), 200, ['Content-Type' => 'application/xml']); | ||
} | ||
|
||
public function lists(Request $request): Response | ||
{ | ||
$lists = LinkList::latest()->with('user')->get(); | ||
$meta = [ | ||
'title' => 'LinkAce Lists', | ||
'link' => $request->fullUrl(), | ||
'updated' => now()->toRfc3339String(), | ||
'id' => $request->fullUrl(), | ||
]; | ||
|
||
return new Response(view('actions.feed.lists', [ | ||
'meta' => $meta, | ||
'lists' => $lists, | ||
]), 200, ['Content-Type' => 'application/xml']); | ||
} | ||
|
||
public function listLinks(Request $request, LinkList $list): Response | ||
{ | ||
$links = $list->links()->with('user')->latest()->get(); | ||
$meta = [ | ||
'title' => $list->name, | ||
'link' => $request->fullUrl(), | ||
'updated' => now()->toRfc3339String(), | ||
'id' => $request->fullUrl(), | ||
]; | ||
|
||
return new Response(view('actions.feed.links', [ | ||
'meta' => $meta, | ||
'links' => $links, | ||
]), 200, ['Content-Type' => 'application/xml']); | ||
} | ||
|
||
public function tags(Request $request): Response | ||
{ | ||
$tags = Tag::latest()->with('user')->get(); | ||
$meta = [ | ||
'title' => 'LinkAce Links', | ||
'link' => $request->fullUrl(), | ||
'updated' => now()->toRfc3339String(), | ||
'id' => $request->fullUrl(), | ||
]; | ||
|
||
return new Response(view('actions.feed.tags', [ | ||
'meta' => $meta, | ||
'tags' => $tags, | ||
]), 200, ['Content-Type' => 'application/xml']); | ||
} | ||
|
||
public function tagLinks(Request $request, Tag $tag): Response | ||
{ | ||
$links = $tag->links()->with('user')->latest()->get(); | ||
$meta = [ | ||
'title' => $tag->name, | ||
'link' => $request->fullUrl(), | ||
'updated' => now()->toRfc3339String(), | ||
'id' => $request->fullUrl(), | ||
]; | ||
|
||
return new Response(view('actions.feed.links', [ | ||
'meta' => $meta, | ||
'links' => $links, | ||
]), 200, ['Content-Type' => 'application/xml']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Guest; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Models\Link; | ||
use App\Models\LinkList; | ||
use App\Models\Tag; | ||
use Illuminate\Http\Request; | ||
use Illuminate\Http\Response; | ||
|
||
class FeedController extends Controller | ||
{ | ||
public function links(Request $request): Response | ||
{ | ||
$links = Link::publicOnly()->latest()->with('user')->get(); | ||
$meta = [ | ||
'title' => 'LinkAce Links', | ||
'link' => $request->fullUrl(), | ||
'updated' => now()->toRfc3339String(), | ||
'id' => $request->fullUrl(), | ||
]; | ||
|
||
return new Response(view('actions.feed.links', [ | ||
'meta' => $meta, | ||
'links' => $links, | ||
]), 200, ['Content-Type' => 'application/xml']); | ||
} | ||
|
||
public function lists(Request $request): Response | ||
{ | ||
$lists = LinkList::publicOnly()->latest()->with('user')->get(); | ||
$meta = [ | ||
'title' => 'LinkAce Lists', | ||
'link' => $request->fullUrl(), | ||
'updated' => now()->toRfc3339String(), | ||
'id' => $request->fullUrl(), | ||
]; | ||
|
||
return new Response(view('actions.feed.lists', [ | ||
'meta' => $meta, | ||
'lists' => $lists, | ||
]), 200, ['Content-Type' => 'application/xml']); | ||
} | ||
|
||
public function listLinks(Request $request, $listID): Response | ||
{ | ||
$list = LinkList::publicOnly()->findOrFail($listID); | ||
$links = $list->links()->publicOnly()->latest()->with('user')->get(); | ||
$meta = [ | ||
'title' => $list->name, | ||
'link' => $request->fullUrl(), | ||
'updated' => now()->toRfc3339String(), | ||
'id' => $request->fullUrl(), | ||
]; | ||
|
||
return new Response(view('actions.feed.links', [ | ||
'meta' => $meta, | ||
'links' => $links, | ||
]), 200, ['Content-Type' => 'application/xml']); | ||
} | ||
|
||
public function tags(Request $request): Response | ||
{ | ||
$tags = Tag::publicOnly()->latest()->with('user')->get(); | ||
$meta = [ | ||
'title' => 'LinkAce Links', | ||
'link' => $request->fullUrl(), | ||
'updated' => now()->toRfc3339String(), | ||
'id' => $request->fullUrl(), | ||
]; | ||
|
||
return new Response(view('actions.feed.tags', [ | ||
'meta' => $meta, | ||
'tags' => $tags, | ||
]), 200, ['Content-Type' => 'application/xml']); | ||
} | ||
|
||
public function tagLinks(Request $request, $tagID): Response | ||
{ | ||
$tag = Tag::publicOnly()->findOrFail($tagID); | ||
$links = $tag->links()->publicOnly()->latest()->with('user')->get(); | ||
$meta = [ | ||
'title' => $tag->name, | ||
'link' => $request->fullUrl(), | ||
'updated' => now()->toRfc3339String(), | ||
'id' => $request->fullUrl(), | ||
]; | ||
|
||
return new Response(view('actions.feed.links', [ | ||
'meta' => $meta, | ||
'links' => $links, | ||
]), 200, ['Content-Type' => 'application/xml']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.