You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
875 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Siswa extends Model
{
use SoftDeletes;
protected $table = 'siswa';
protected $fillable = [
'kelas_id',
'nama',
'tempat_lahir',
'tanggal_lahir',
'jenis_kelamin',
'alamat',
'nama_wali',
'telp_wali',
'pekerjaan_wali',
'is_yatim'
];
public function kelas(){
return $this->hasOne('App\Models\Kelas','id','kelas_id');
}
public function transaksi(){
return $this->hasMany('App\Models\Transaksi','siswa_id','id');
}
public function role(){
return $this->hasMany('App\Models\Role','siswa_id','id');
}
public function tabungan(){
return $this->hasMany('App\Models\Tabungan','siswa_id','id');
}
}