Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

relation on json or array records #2494

Unanswered
AliAmini78 asked this question in Q&A
Discussion options

Laravel Version: 9
PHP Version: 8.1
jenssegers/mongodbn: 3.9

i have two models and i want them to have a relation together , Property and Attributes

and property record is :

Property :=> [
 "_id" => "63bbb87fb7200dc8b30f45d2"
 "title" => "apartment",
 "attribute_json"=> [
 [
 "attribute_id" => 63b44c35eb7f96ff2308d09a,
 "options" => [
 "value" => 123,
 "option_id" => "63b44c35eb7f96ff2308d09b"
 ]
 ], [
 "attribute_id" => 63b5663879968d98e301b251,
 "options" => [
 "value" => 123,
 "option_id" =>[
 "63b6899342a118a29a2292d9",
 "63b51efe79968d98e301b23f"
 ]
 ]
 ],
 [
 "attribute_id" => 63b5664879968d98e301b252,
 "options" => [
 "option_id" => "63b5023c79968d98e301b236"
 ]
 ], 
[
 "attribute_id" => 63b6d35d585250198b0230e2,
 "options" => [
 "option_id" => [
 "63b6d35d585250198b0230e3"
 "63b6d35d585250198b0230e4"
 ]
 ]
 ],
 [
 "attribute_id" => 63b6d35d585250198b0230e5,
 "options" => [
 "value" => 456,
 ]
 ],
 
 ],
]

and in this record attribute_id and option_id is in same model and table .
and how can i make relation between attribute_id and property , and also make another relation between option_id and property ?

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /