32 lines
627 B
PHP
32 lines
627 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Contact extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array<int, string>
|
|
*/
|
|
protected $fillable = [
|
|
'pemilik_kontak',
|
|
'relasi_kontak',
|
|
];
|
|
|
|
//Relasi
|
|
public function pemilik_kontak(){
|
|
return $this->belongsTo(User::class, 'email', 'pemilik_kontak');
|
|
}
|
|
|
|
public function relasi_kontak(){
|
|
return $this->belongsTo(User::class, 'email', 'relasi_kontak');
|
|
}
|
|
//Relasi
|
|
}
|