*/ protected $fillable = [ 'nama', 'tanggal_lahir', 'alamat', 'email', 'no_telephone', 'tanggal_masuk', 'status', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'tanggal_lahir' => 'date', 'tanggal_masuk' => 'date', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; /** * The attributes that should be hidden for serialization. * * @var array */ protected $hidden = []; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'tanggal_lahir' => 'date', 'tanggal_masuk' => 'date', ]; } /** * Scope a query to only include active teknisi. */ public function scopeAktif($query) { return $query->where('status', 'aktif'); } /** * Scope a query to only include inactive teknisi. */ public function scopeTidakAktif($query) { return $query->where('status', 'tidak_aktif'); } }