'array', ]; /** * The table associated with the model. * * @var string */ protected $table = 'form_cuti'; public function staff(): BelongsTo { return $this->belongsTo(User::class, 'staff_id'); } public function creator(): BelongsTo { return $this->belongsTo(User::class, 'creator_id'); } // public function createRow(array $row): void // { // $row = Arr::only($row, ['tgl_mulai', 'tgl_selesai']); // $row['form_cuti_id'] = $this->id; // $row['supervisor'] = [ // 'id' => null, // 'terima' => false, // 'keterangan' => null, // ]; // $row['personalia'] = [ // 'id' => $this->creator->id, // 'terima' => false, // 'keterangan' => null, // ]; // // this runs setDataAttribute // if (isset($this->attributes['data'])) { // $this->data = array_merge($this->attributes['data'], [$row]); // } else { // $this->data = [$row]; // } // } }