first commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Poin;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class PoinTendikResource extends JsonResource
|
||||
{
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'poin' => array_sum($this->resource['penunjang']) + $this->resource['penunjang']['Pendidikan']->sum() + $this->resource['skp']['poin'] + $this->resource['presensi'],
|
||||
'detail' => [
|
||||
'penunjang' => [
|
||||
'poin' => array_sum($this->resource['penunjang']) + $this->resource['penunjang']['Pendidikan']->sum(),
|
||||
'detail' => $this->resource['penunjang']
|
||||
],
|
||||
'presensi' => round($this->resource['presensi'], 2),
|
||||
'skp' => $this->resource['skp']['poin'],
|
||||
'publikasi' => $this->resource['publikasi'],
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user