31 lines
784 B
PHP
31 lines
784 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources\Jabatan;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class JabatanFungsionalResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
if ($this->fungsional === null) {
|
|
return null;
|
|
}
|
|
|
|
return [
|
|
'month' => month($this->bulan),
|
|
'id' => $this->fungsional?->id,
|
|
'name' => $this->fungsional?->nama,
|
|
'status_pns' => $this?->status_pns ?? 'PNS',
|
|
'golongan' => $this->golongan,
|
|
'status' => $this->status_jf,
|
|
];
|
|
}
|
|
}
|