暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

PetugasUnitDonorDarahUdds.php 866B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace App\Model\User;
  3. use Illuminate\Database\Eloquent\Model;
  4. class PetugasUnitDonorDarahUdds extends Model
  5. {
  6. //protected $connection = 'connection-name'; //jika menggunakan 2 DB modelnya harus dikasih ini
  7. //protected $primaryKey = 'your_key_name'; // set primarykeymu jika bukan ID
  8. protected $table = 'petugas_unit_donor_darah_udds';
  9. protected $fillable = [
  10. 'nama',
  11. 'unit_donor_darah_id',
  12. 'user_login_id'
  13. ];
  14. //public $incrementing = false; //jika primary keynya string
  15. //public $timestamps = false; //matiin created_at, updated_at
  16. public function user()
  17. {
  18. //localkeymu, idnya
  19. return $this->belongsTo('App\User', 'user_login_id', 'id');
  20. }
  21. public function udd()
  22. {
  23. return $this->belongsTo('App\Model\Master\MasterUdd', 'unit_donor_darah_id', 'id');
  24. }
  25. }