123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
-
- namespace App\Model\User;
-
- use Illuminate\Database\Eloquent\SoftDeletes;
-
-
- use Illuminate\Database\Eloquent\Model;
-
- class MasterRumahSakits extends Model
- {
- use SoftDeletes;
- //protected $connection = 'connection-name'; //jika menggunakan 2 DB modelnya harus dikasih ini
- //protected $primaryKey = 'your_key_name'; // set primarykeymu jika bukan ID
- protected $table = 'master_rumah_sakits';
- protected $fillable = [
- 'nama',
- 'kode_rumah_sakit',
- 'deskripsi',
- 'alamat',
- 'latitude',
- 'longtitude',
- 'nama_bank_darah',
- 'user_login_id',
- 'provinsi_id',
- 'kabupaten_kota_id'
- ];
- //public $incrementing = false; //jika primary keynya string
- //public $timestamps = false; //matiin created_at, updated_at
-
- public function user()
- {
- return $this->belongsTo('App\User', 'user_login_id', 'id');
- }
- public function kota()
- {
- return $this->belongsTo('App\Model\Master\KabupatenKota', 'kabupaten_kota_id', 'id');
- }
- }
|