2021-01-17 08:38:01 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use App\Models\InstanceActor;
|
|
|
|
use Cache;
|
|
|
|
|
|
|
|
class InstanceActorController extends Controller
|
|
|
|
{
|
|
|
|
public function profile()
|
|
|
|
{
|
|
|
|
$res = Cache::rememberForever(InstanceActor::PROFILE_KEY, function() {
|
|
|
|
$res = (new InstanceActor())->first()->getActor();
|
2021-10-07 06:46:20 +00:00
|
|
|
return json_encode($res, JSON_UNESCAPED_SLASHES);
|
2021-01-17 08:38:01 +00:00
|
|
|
});
|
2022-12-12 23:30:48 +00:00
|
|
|
return response($res)->header('Content-Type', 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"');
|
2021-01-17 08:38:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function inbox()
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function outbox()
|
|
|
|
{
|
2022-02-03 00:55:29 +00:00
|
|
|
$res = json_encode([
|
2021-01-17 08:38:01 +00:00
|
|
|
'@context' => 'https://www.w3.org/ns/activitystreams',
|
|
|
|
'id' => config('app.url') . '/i/actor/outbox',
|
|
|
|
'type' => 'OrderedCollection',
|
|
|
|
'totalItems' => 0,
|
|
|
|
'first' => config('app.url') . '/i/actor/outbox?page=true',
|
|
|
|
'last' => config('app.url') . '/i/actor/outbox?min_id=0page=true'
|
2022-02-03 00:55:29 +00:00
|
|
|
], JSON_UNESCAPED_SLASHES);
|
2022-12-12 23:30:48 +00:00
|
|
|
return response($res)->header('Content-Type', 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"');
|
2021-01-17 08:38:01 +00:00
|
|
|
}
|
|
|
|
}
|