Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Models;
  4.  
  5. use Illuminate\Database\Eloquent\Model;
  6.  
  7. class Employee extends Model
  8. {
  9. protected $fillable = ['nip','name','bdate','address','gender','unit_id','departemen_id'];
  10.  
  11. protected $primaryKey = 'nip';
  12.  
  13. function unit(){
  14. return $this->belongsTo('App\Models\Unit')->withDefault(['name'=>' ']);
  15. }
  16.  
  17. function departemen(){
  18. return $this->belongsTo('App\Models\Departemen')->withDefault(['name'=>' ']);
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement