*/ protected $table = 'user'; protected $primaryKey = 'id_user'; public $incrementing = false; protected $fillable = [ 'id_user', 'nama', 'no_telepon', 'email_verified', 'kode_verified', 'token', 'token_fcm', 'alamat', 'longitude', 'latitude', 'email', 'password', 'id_role', // customer 'foto', 'created_at', 'updated_at', ]; // Relationship dengan tabel Role public function role() { return $this->belongsTo(Role::class, 'id_role'); } // Relationship dengan tabel Pickup (sebagai customer) public function pickupsAsCustomer() { return $this->hasMany(Pickup::class, 'id_customer'); } // Relationship dengan tabel Pickup (sebagai pegawai) public function pickupsAsPegawai() { return $this->hasMany(Pickup::class, 'id_pegawai'); } /** * The attributes that should be hidden for serialization. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'email_verified_at' => 'datetime', ]; }