Schemaless attributes? #319
Answered
by
rubenvanassche
francoism90
asked this question in
Q&A
-
https://github.com/spatie/laravel-schemaless-attributes class PostData extends Data
{
public function __construct(
public string $id,
public Lazy|SchemalessAttributes $meta,
) {
}
public static function fromModel(Post $model): self
{
return new self(
id: $model->getRouteKey(),
meta: Lazy::create(fn () => $model->meta),
);
}
} I would only allow to include a schemaless property:
Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
rubenvanassche
Jan 9, 2023
Replies: 1 comment
-
Though these are two Spatie packages, I don't think we're going to support this because it takes us too far away. I would make the schemaless attributes properties on the data object. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
francoism90
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Though these are two Spatie packages, I don't think we're going to support this because it takes us too far away. I would make the schemaless attributes properties on the data object.