<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Pembayaran extends Model
{
use HasFactory;
protected $fillable = [
'no_pembayaran',
'siswa_id',
'user_id',
'metode_pembayaran',
'bukti_pembayaran',
'tanggal_pembayaran',
'total_pembayaran',
'status_pembayaran',
'tanggapan',
'tahun_ajaran_id'
];
public function tahun_ajaran(){
return $this->belongsTo(TahunAjaran::class);
}
public function siswa()
{
return $this->belongsTo(Siswa::class)->withDefault([
'nama_siswa' => 'TIDAK ADA DATA / DIHAPUS',
'nis' => 'TIDAK ADA DATA / DIHAPUS',
]);
}
public function user()
{
return $this->belongsTo(User::class)->withDefault([
'nama' => 'TIDAK ADA DATA / DIHAPUS'
]);
}
public function detail_pembayarans()
{
return $this->hasMany(DetailPembayaran::class);
}
public function setor_details()
{
return $this->hasMany(SetorDetail::class);
}
}
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]