<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class KelompokTani extends Model
{
    use HasFactory;
    protected $table = 'kelompok_tani';

    protected $fillable = ['nama'];
        public function members()
    {
        return $this->hasMany(MemberKelompokTani::class);
    }
    public function users()
    {
        return $this->belongsToMany(User::class, 'member_kelompok_tani', 'kelompok_tani_id', 'user_id');
    }

}
