6
0
Fork 0
jiqu-library-server/app/Endpoint/Api/Http/Resources/UserWalletResource.php

26 lines
716 B
PHP

<?php
namespace App\Endpoint\Api\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class UserWalletResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
*/
public function toArray($request)
{
return [
// 'balance'=>$this->balance,
// 'total_expenses'=> $this->total_expenses,
// 'total_revenue' => $this->total_revenue,
// 'withdrawable' => $this->withdrawable,
'has_password' => (bool) is_null($this?->password) ? false : true,
];
}
}