27 lines
579 B
PHP
27 lines
579 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class PermohonanItem extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'permohonan_id', 'item', 'kuantiti', 'harga_anggaran', 'jumlah',
|
|
'status_item', 'catatan_pelaksana',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['harga_anggaran' => 'decimal:2', 'jumlah' => 'decimal:2'];
|
|
}
|
|
|
|
public function permohonan()
|
|
{
|
|
return $this->belongsTo(Permohonan::class, 'permohonan_id');
|
|
}
|
|
}
|