<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Dpt extends Model
{
//
// protected $table = 'data_wargas';
protected $guarded = [];
public function tp()
{
return $this->belongsTo(Tp::class, 'tps_id', 'id');
}
public function user()
{
return $this->belongsTo(User::class);
}
public function getTanggalLahirAttribute()
{
return explode(' , ', $this->ttl)[1] ?? null;
}
public function getTempatLahirAttribute()
{
return explode(' , ', $this->ttl)[0] ?? null;
}
}
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]