You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

34 lines
741 B

<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class FingerprintResource extends JsonResource
{
public function toArray($request)
{
$resource = [
'_service' => 'user',
'_resource' => 'fingerprints',
];
foreach ($this->getAttributes() as $attribute => $value) {
switch ($attribute) {
case 'id':
case 'agent':
case 'ip':
case 'os':
case 'latitude':
case 'longitude':
case 'token':
$resource[$attribute] = $value;
break;
}
}
return $resource;
}
}