You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pixelfed/app/Http/Resources/StoryView.php

29 lines
596 B
PHTML

<?php
namespace App\Http\Resources;
use App\Services\AccountService;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
4 weeks ago
use Illuminate\Support\Carbon;
/**
* @property int $profile_id
4 weeks ago
* @property Carbon $created_at
*/
class StoryView extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request)
{
$res = AccountService::get($this->profile_id, true);
$res['viewed_at'] = $this->created_at->format('c');
return $res;
}
}