Files
expense/app/Models/FormEntertaimentPresentation.php
root 1c1418f3e0
Deploy to VPS (PAT over HTTPS) / deploy (push) Has been cancelled
Initial commit - expense
2026-06-01 15:01:03 +07:00

71 lines
1.6 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class FormEntertaimentPresentation extends Model
{
use SoftDeletes, \App\Traits\HasAttachments;
protected $table = 'form_entertainment_presentation';
protected $fillable = [
'expense_number',
'user_id',
'tanggal',
'jenis',
'keterangan',
'total',
'approved_total',
'name',
'alamat',
'nik_or_npwp',
'bukti_total',
'account_number',
'status',
'remarks',
'approved_at',
'approved2_at',
'approved_by',
'approved2_by',
'final_approved_at',
'final_approved_by',
// Kolom baru
'jabatan',
'nama_perusahaan',
'jenis_usaha',
];
protected $casts = [
'created_at' => 'datetime',
'approved_at' => 'datetime',
'approved2_at' => 'datetime',
'final_approved_at' => 'datetime',
];
public function user()
{
return $this->belongsTo('App\Models\Admin');
}
// Relasi ke kategori untuk mengambil account_number
public function kategori()
{
return $this->belongsTo(Kategori::class, 'kategori_id');
}
public function rejector() {
return $this->belongsTo(User::class, 'rejected_by');
}
// public function attachments()
// {
// // form_id adalah kolom di tabel attachment_forms
// // table_name digunakan jika satu tabel attachment dipakai banyak form
// return $this->hasMany(\App\Models\AttachmentForm::class, 'form_id')
// ->where('table_name', 'form_entertainment_presentation');
// }
}