Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- class Employee extends Model
- {
- protected $fillable = ['nip','name','bdate','address','gender','unit_id','departemen_id'];
- protected $primaryKey = 'nip';
- function unit(){
- return $this->belongsTo('App\Models\Unit')->withDefault(['name'=>' ']);
- }
- function departemen(){
- return $this->belongsTo('App\Models\Departemen')->withDefault(['name'=>' ']);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement