MIF_E31210141/app/Models/Konselor.php

36 lines
1.0 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Konselor extends Model
{
use HasFactory;
protected $table = 'tbl_konselor'; // 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
protected $fillable = [
'id',
'user_id',
'nip',
'alamat',
'telepon',
'agama',
];
public $timestamps = false;
protected $casts = [
'telepon' => 'integer', // Cast the 'telepon' attribute to integer
'agama' => 'integer', // Cast the 'agama' attribute to integer
];
public function user()
{
return $this->hasMany(User::class, 'id', 'user_id');
}
}