MIF_E31210385/app/Models/Guru.php

31 lines
849 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Guru extends Model
{
use HasFactory;
protected $table = 'tbl_guru'; // Specify the name of your table if it's different from the convention
protected $primaryKey = 'id'; // Specify the primary key if it's different from 'id'
public $incrementing = false; // Set to false if the primary key is not auto-incrementing
protected $keyType = 'string'; // Set the data type of the primary key if it's not an integer
public $timestamps = false;
protected $fillable = [
'id',
'id_user',
'nip',
'alamat',
'agama',
'telepon',
'status'
];
public function user()
{
return $this->hasOne(User::class, 'id', 'id_user');
}
}