first commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?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,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user