@extends('layouts.master') @section('title') {{$title}} @lang('translation.starter') @endsection @section('content') @component('components.breadcrumb') @slot('li_1') Pages @endslot @slot('title') {{$title}} @endslot @endcomponent

List {{ $title }}

{{-- @can('create') Create @endcan --}}
@foreach ($prods as $item) @php if(!empty($item->Kepegawaian->tgl_sk_tetap)){ $tanggal=date('d-m-Y',strtotime($item->tgl_sk_tetap)); // $usia=\Carbon\Carbon::parse($item->Kepegawaian->tgl_sk_kontrak)->age; $dateOfBirth = \Carbon\Carbon::parse($item->tgl_sk_tetap); $now = \Carbon\Carbon::now(); $diff = $dateOfBirth->diff($now); $years = $diff->y; // Tahun $months = $diff->m; // Bulan // Menampilkan usia dalam format "tahun tahun dan bulan bulan" $usia = $months > 0 ? "$years tahun ".$months." Bulan ":"$years tahun"; }else{ $usia='-'; $tanggal='-'; } @endphp @endforeach
Nama pegawai Tanggal SK Tetap Masa Kerja
{{ $item->nama_depan }} {{ $item->nama_belakang }} {{ $tanggal }} {{ $usia }}
@endsection @section('script') @include('datatable') @endsection