35 lines
761 B
PHP
35 lines
761 B
PHP
<?php
|
|
|
|
namespace App\Models\Konfigurasi;
|
|
|
|
use App\Models\Concerns\HasDeletedBy;
|
|
use App\Models\Pertanian\Komoditas;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class KoordinatorKomoditas extends Model
|
|
{
|
|
use SoftDeletes, HasDeletedBy;
|
|
|
|
protected $table = 'koordinator_komoditas';
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'komoditas_id',
|
|
'created_by',
|
|
'updated_by',
|
|
];
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
}
|
|
|
|
public function komoditas(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Komoditas::class, 'komoditas_id');
|
|
}
|
|
}
|