update kolompok belajar

This commit is contained in:
2026-05-19 11:10:53 +07:00
parent 5d6b79aa4a
commit 1ca9d96779
10 changed files with 624 additions and 1 deletions
+38
View File
@@ -0,0 +1,38 @@
<?php
namespace App\Models\Program;
use Illuminate\Database\Eloquent\Model;
use App\Models\User;
class DetailKelompok extends Model
{
protected $table = 'detail_kelompok';
protected $fillable = [
'kelompok_id',
'user_id',
'nama_anggota',
'jabatan',
'no_hp',
'alamat'
];
// RELASI KE KELOMPOK
public function kelompok()
{
return $this->belongsTo(
KelompokBelajarTani::class,
'kelompok_id'
);
}
// RELASI KE USER
public function user()
{
return $this->belongsTo(
User::class,
'user_id'
);
}
}
@@ -4,6 +4,7 @@ namespace App\Models\Program;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Models\Program\DetailKelompok;
class KelompokBelajarTani extends Model
{
@@ -19,4 +20,11 @@ class KelompokBelajarTani extends Model
'updated_by',
'deleted_by',
];
public function detailAnggota(){
return $this->hasMany(
DetailKelompok::class,
'kelompok_id'
);
}
}
+1 -1
View File
@@ -37,7 +37,7 @@ class User extends Authenticatable
];
}
protected function profile(): HasOne
public function profile(): HasOne
{
return $this->hasOne(\App\Models\Profile::class);
}