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
2019-11-22 16:13:42 +01:00

36 lines
812 B
PHP

<?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;
}
/*if($this->typ == "password") {
$data["value"] = null;
}*/
return $data;
}
}