belongsTo(User::class, 'id_customer', 'id_user'); } public function customer() { return $this->belongsTo(User::class, 'id_customer', 'id_user'); } public function checkboxOptions() { return $this->hasMany(Items::class, 'kode_pu', 'kode_pu'); } public function getFormattedCreatedAtAttribute() { return Carbon::parse($this->attributes['created_at'])->format('Y-m-d H:i'); } public function getFormattedUpdatedAtAttribute() { return Carbon::parse($this->attributes['updated_at'])->format('Y-m-d H:i'); } }