ekosistem dan framework
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Program;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
use App\Models\Program\Target;
|
||||
|
||||
class Realisasi extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'program_realisasi';
|
||||
|
||||
protected $fillable = [
|
||||
"target_id",
|
||||
"realisasi_integer",
|
||||
"realisasi_float",
|
||||
"realisasi_boolean",
|
||||
"created_by",
|
||||
"updated_by",
|
||||
"deleted_by",
|
||||
];
|
||||
|
||||
public function target(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Target::class, 'target_id', 'id');
|
||||
}
|
||||
|
||||
public function verifikasi(): HasMany
|
||||
{
|
||||
return $this->hasMany(Verifikasi::class, 'realisasi_id', 'id')->oldest();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user