| 12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- namespace App\Model;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\SoftDeletes;
- class TahunProgram extends Model
- {
- use SoftDeletes;
- protected $table = "tahun_program";
- protected $fillable = [
- 'label_tahun_program',
- 'value',
- 'status',
- 'created_by',
- 'modified_by'
- ];
- public function tahunProgram(){
- return $this->hasMany('App\Model\TahunProgramDetail', 'id_tahun_program');
- }
- public function tahunProgramDetail(){
- return $this->hasMany('App\Model\TahunProgramDetail', 'id_tahun_program');
- }
- /**
- * @return mixed
- */
- public function getTotalPeriodeAttribute()
- {
- return $this->tahunProgramDetail->count();
- }
- }
|