This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hi. I have 3 model:
- Object
- Room
- Record
Object has many Room, Room has many Record.
How to make in one controller? Example: Create Object, and create room in this page ( relation ) and in relation modal create records. Object and Record no relation.
Sorry for my English.
You will have to use the RelationController Behavior and set up the relations of your models and controllers correctly. Please refer here for database relations and here for the backend relations.
@philipptempel I have relations models: Model Object :
public $hasMany = [
'rooms' => ['Plugin\Dispute\Models\Room'],
];
Model Room:
public $belongsToMany = [
'discussions' => ['Plugin\Dispute\Models\Discussion'],
];
public $hasMany = [
'roomUser' => ['Plugin\Dispute\Models\RoomUser'],
];
Model Record:
public $belongsToMany = [
'room' => ['Plugin\Dispute\Models\Room'],
];
Last updated
How does your backend controllers' setup look like? How do the .yaml
files for that look like? Please read the docs I posted above, read them, understand them, follow them, and then please come back with some precise problems. The docs include everything you need to know (even sample code) to help you get started. Also check the resources page which has a great video tutorial on @daftspunk CRM plugin which relates to your topic.
@philipptempel
Here is my problem : https://github.com/octobercms/october/issues/1959 https://github.com/ebhoren/octobercms-nested-relations
Last updated
1-5 of 5