return as2.0 data for website owner
This commit is contained in:
parent
c576298f7a
commit
0d5a865701
1 changed files with 14 additions and 3 deletions
|
@ -11,13 +11,24 @@ use Jonnybarnes\IndieWeb\Numbers;
|
|||
class NotesController extends Controller
|
||||
{
|
||||
/**
|
||||
* Show all the notes.
|
||||
* Show all the notes. This is also the homepage.
|
||||
*
|
||||
* @param Illuminate\Http\Request request;
|
||||
* @return \Illuminte\View\Factory view
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index()
|
||||
{
|
||||
if (request()->wantsActivityStream()) {
|
||||
$data = json_encode([
|
||||
'@context' => 'https://www.w3.org/ns/activitystreams',
|
||||
'id' => 'https://jonnybarnes.uk',
|
||||
'type' => 'Person',
|
||||
'name' => 'Jonny Barnes',
|
||||
'preferredUsername' => 'jonnybarnes',
|
||||
]);
|
||||
|
||||
return response($data)->header('Content-Type', 'application/activity+json');
|
||||
}
|
||||
|
||||
$notes = Note::orderBy('id', 'desc')
|
||||
->with('place', 'media', 'client')
|
||||
->withCount(['webmentions As replies' => function ($query) {
|
||||
|
|
Loading…
Add table
Reference in a new issue