30 lines
813 B
PHP
30 lines
813 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources\Presensi;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class AbsenResource 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 [
|
|
'id' => $this->id,
|
|
'tanggal' => $this->tanggal_mulai,
|
|
'kategori' => $this->kategori,
|
|
'keterangan' => $this->keterangan,
|
|
'status' => $this->status,
|
|
'alasan' => $this->notes?->last()?->message,
|
|
'bukti' => $this->file,
|
|
'siska_id' => $this->siska_id,
|
|
'file_lampiran' => $this->file_lampiran,
|
|
];
|
|
}
|
|
}
|