45 lines
931 B
PHP
45 lines
931 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class Transaksi extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'transaksi';
|
|
|
|
protected $fillable = [
|
|
'created_at',
|
|
'created_by',
|
|
'updated_at',
|
|
'updated_by',
|
|
|
|
'id_registrasi',
|
|
'id_tindakan',
|
|
'jml_tindakan',
|
|
'potongan',
|
|
'subtotal',
|
|
'total',
|
|
'id_pegawai',
|
|
];
|
|
|
|
public function registrasi() : BelongsTo
|
|
{
|
|
return $this->belongsTo(Registrasi::class, 'id_registrasi', 'id');
|
|
}
|
|
|
|
public function tindakan() : BelongsTo
|
|
{
|
|
return $this->belongsTo(Tindakan::class, 'id_tindakan', 'id');
|
|
}
|
|
|
|
public function pegawai() : BelongsTo
|
|
{
|
|
return $this->belongsTo(Pegawai::class, 'id_pegawai', 'id');
|
|
}
|
|
}
|