validated(key: 'scope'), description: $request->validated(key: 'description'), bits: $request->validated(key: 'bits'), parent_id: $request->validated(key: 'parent_id'), ); } public static function fromArray(array $data): self { return new self( scope: $data['scope'], description: $data['description'], bits: $data['bits'], parent_id: isset($data['parent_id']) ? $data['parent_id'] : null, ); } public function toArray(): array { return [ 'scope' => $this->scope, 'description' => $this->description, 'bits' => $this->bits, 'parent_id' => $this->parent_id, ]; } }