mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-02-06 05:29:31 +01:00
29 lines
871 B
PHP
29 lines
871 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Resources;
|
||
|
|
||
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||
|
|
||
|
class TwoFAccountStoreResource extends JsonResource
|
||
|
{
|
||
|
/**
|
||
|
* Transform the resource into an array.
|
||
|
*
|
||
|
* @param \Illuminate\Http\Request $request
|
||
|
* @return array
|
||
|
*/
|
||
|
public function toArray($request)
|
||
|
{
|
||
|
return [
|
||
|
'otp_type' => $this->otp_type,
|
||
|
'account' => $this->account,
|
||
|
'service' => $this->service,
|
||
|
'icon' => $this->icon,
|
||
|
'secret' => $this->when((int) filter_var($request->input('hideSecret'), FILTER_VALIDATE_BOOLEAN) == 0, $this->secret),
|
||
|
'digits' => $this->digits,
|
||
|
'algorithm' => $this->algorithm,
|
||
|
'period' => $this->period,
|
||
|
'counter' => $this->counter
|
||
|
];
|
||
|
}
|
||
|
}
|