python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
How do you create and save an Active Record instance that has a reference to itself?
Files is an Active Record model that has a reference to its parent of the same type:
class Files < ActiveRecord::Base
belongs_to :parent, class_name: "Files"
end
I want to create a roo...
pedz
Votes: 0
Answers: 1
Property [group] does not exist on this collection instance
I have retrieved an instance of a product item at blade, so when I do dd($product), I get this result:
And the Product Model is connected to GroupProduct Model like this:
public function groupproduct...
Pouya
Votes: 0
Answers: 3
Make Hidden child's relation /Laravel Eloquent
Model structure:
AccessoryGroup (hasMany: accessories)
Accessory (belongsTo: accessory_group)
Get all accessory groups with accessories (with accesory_group)
In accessories I needed accessory_group ...
Jan Grb
Votes: 0
Answers: 1
Deep relations, *child* relation depends on *great-grandparent* id - with | load - Laravel/Eloquent
I have this DB/Model structure (example):
*Food Category ------------ (id, name) - *irrelevant
Foods ---------------------- (id, food_category_id, name, ...)
Accessory Groups --------- (id, name, ...)...
Jan Grb
Votes: 0
Answers: 2