This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hello,
I have two database peoples ['name','family','gender','type_id']
and types [id,name,status]
I have a problem, type just could be for one people! and when I use same type for another people previous record will set to 0 and current people get type. i just could set type just to one people!
any one know why it's occure?
In People Model you should use something like this
public $belongsTo = [
'types' => ['NameOfRootFolderWithYourPlugins\NameOfPlugin\Models\Types', 'order' => 'name']
];
i explain it again with more description:
we have two table:
user_table[id,name,family,email,status]
and another table is user_status_table[id,name]
I want to load status values from user_status_table
when editing users.
I think i found the solution. I should define new function for it not relation. and it's work as well.
1-5 of 5