env and vendor added temporary

This commit is contained in:
2025-04-09 16:39:53 +02:00
parent 35e90c283e
commit 43b1cb2202
10304 changed files with 1205060 additions and 254 deletions
@@ -0,0 +1,31 @@
<?php
namespace Vanguard\UserActivity\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class ActivityResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
*/
public function toArray($request): array
{
$agent = app('agent');
$agent->setUserAgent($this->resource->user_agent);
return [
'id' => (int) $this->id,
'user_id' => (int) $this->user_id,
'ip_address' => $this->ip_address,
'user_agent' => $this->user_agent,
'browser' => $agent->browser(),
'platform' => $agent->platform(),
'device' => $agent->device(),
'description' => $this->description,
'created_at' => (string) $this->created_at,
];
}
}