|Lembur newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|Lembur newQuery() * @method static \Illuminate\Database\Eloquent\Builder|Lembur query() * @method static \Illuminate\Database\Eloquent\Builder|Lembur whereAlasanPenolakan($value) * @method static \Illuminate\Database\Eloquent\Builder|Lembur whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Lembur whereDurasiMenit($value) * @method static \Illuminate\Database\Eloquent\Builder|Lembur whereIdKompensasi($value) * @method static \Illuminate\Database\Eloquent\Builder|Lembur whereIdLembur($value) * @method static \Illuminate\Database\Eloquent\Builder|Lembur whereIdStatus($value) * @method static \Illuminate\Database\Eloquent\Builder|Lembur whereIdUser($value) * @method static \Illuminate\Database\Eloquent\Builder|Lembur whereJamMulai($value) * @method static \Illuminate\Database\Eloquent\Builder|Lembur whereJamSelesai($value) * @method static \Illuminate\Database\Eloquent\Builder|Lembur whereJumlahPoin($value) * @method static \Illuminate\Database\Eloquent\Builder|Lembur whereKeterangan($value) * @method static \Illuminate\Database\Eloquent\Builder|Lembur whereTanggalDiajukan($value) * @method static \Illuminate\Database\Eloquent\Builder|Lembur whereTanggalLembur($value) * @method static \Illuminate\Database\Eloquent\Builder|Lembur whereUpdatedAt($value) * @mixin \Eloquent */ class Lembur extends Model { use HasFactory; protected $table = 'lembur'; protected $primaryKey = 'id_lembur'; public $incrementing = false; protected $keyType = 'string'; protected static function booted() { static::creating(function ($model) { if (empty($model->{$model->getKeyName()})) { $prefix = 'LMB-' . date('ym') . '-'; $model->{$model->getKeyName()} = $prefix . strtoupper(\Illuminate\Support\Str::random(5)); } }); } protected $fillable = [ 'id_user', 'tanggal_lembur', 'jam_mulai', 'jam_selesai', 'durasi_menit', 'keterangan', 'jumlah_poin', 'id_kompensasi', 'id_status', 'alasan_penolakan', 'tanggal_diajukan' ]; protected $casts = [ 'tanggal_lembur' => 'date', 'tanggal_diajukan' => 'datetime', ]; public function user() { return $this->belongsTo(User::class, 'id_user'); } public function kompensasi() { return $this->belongsTo(JenisKompensasi::class, 'id_kompensasi'); } public function status() { return $this->belongsTo(StatusPengajuan::class, 'id_status'); } }