sidakpelem/app/Models/Pengajuan.php

61 lines
1.1 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Pengajuan extends Model
{
use HasFactory;
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'pengajuan';
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'id_user',
'id_attendance',
'date',
'keterangan',
'url_bukti',
'status',
];
/**
* The attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'date' => 'date',
];
}
/**
* Get the user that owns this pengajuan.
*/
public function user()
{
return $this->belongsTo(User::class, 'id_user');
}
/**
* Get the attendance associated with this pengajuan.
*/
public function attendance()
{
return $this->belongsTo(Attendance::class, 'id_attendance');
}
}