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

MasterRumahSakits.php 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace App\Model\User;
  3. use Illuminate\Database\Eloquent\SoftDeletes;
  4. use Illuminate\Database\Eloquent\Model;
  5. class MasterRumahSakits extends Model
  6. {
  7. use SoftDeletes;
  8. //protected $connection = 'connection-name'; //jika menggunakan 2 DB modelnya harus dikasih ini
  9. //protected $primaryKey = 'your_key_name'; // set primarykeymu jika bukan ID
  10. protected $table = 'master_rumah_sakits';
  11. protected $fillable = [
  12. 'nama',
  13. 'kode_rumah_sakit',
  14. 'deskripsi',
  15. 'alamat',
  16. 'latitude',
  17. 'longtitude',
  18. 'nama_bank_darah',
  19. 'user_login_id',
  20. 'provinsi_id',
  21. 'kabupaten_kota_id'
  22. ];
  23. //public $incrementing = false; //jika primary keynya string
  24. //public $timestamps = false; //matiin created_at, updated_at
  25. public function user()
  26. {
  27. return $this->belongsTo('App\User', 'user_login_id', 'id');
  28. }
  29. public function kota()
  30. {
  31. return $this->belongsTo('App\Model\Master\KabupatenKota', 'kabupaten_kota_id', 'id');
  32. }
  33. }