25 lines
588 B
PHP
25 lines
588 B
PHP
|
|
<?php
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||
|
|
|
||
|
|
class Transaction extends Model
|
||
|
|
{
|
||
|
|
use SoftDeletes;
|
||
|
|
|
||
|
|
protected $fillable = [
|
||
|
|
'cabang_id', 'budget_control_id', 'transaction_date', 'reference_number',
|
||
|
|
'description', 'amount', 'type', 'category', 'periode_month',
|
||
|
|
'periode_year', 'created_by'
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'transaction_date' => 'date',
|
||
|
|
'amount' => 'decimal:2',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function cabang() {
|
||
|
|
return $this->belongsTo(Cabang::class);
|
||
|
|
}
|
||
|
|
}
|