MIF_E31210141/app/Models/Siswa.php

40 lines
1.0 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Siswa extends Model
{
use HasFactory;
protected $table = 'tbl_siswa'; // 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',
'user_id',
'nis',
'agama',
'agama_ayah',
'kota_siswa',
'alamat',
'nama_ibu',
'telepon',
'pekerjaan_ibu',
'pekerjaan_ayah',
'tempat_lahir',
'nama_ayah',
'tanggal_lahir',
'telepon_ortu',
'agama_ibu',
];
public function user()
{
$this->hasMany(User::class, 'id', 'user_id');
}
}