This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccount/app/Http/Resources/API/Setting.php

37 lines
812 B
PHP
Raw Normal View History

<?php
namespace App\Http\Resources\API;
use Illuminate\Http\Resources\Json\JsonResource;
class Setting extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
$data = [
'name' => $this->name,
//'created_at' => $this->created_at,
//'updated_at' => $this->created_at,
'description' => $this->description,
'typ' => $this->typ,
'value' => $this->value,
];
if($this->typ == "checkbox") {
$data["value"] = (bool)$this->value;
}
2019-11-22 15:13:42 +00:00
/*if($this->typ == "password") {
$data["value"] = null;
2019-11-22 15:13:42 +00:00
}*/
return $data;
}
2019-11-22 15:13:42 +00:00
}