Postingan lainnya
relasi antar table
satu user hanya boleh punya satu hak akses, user atau admin. hak akses dapat dipunyai oleh semua user.
itu relasi apa ya? one to many ya? kasih referensi buat belajar ini dong :D
1
3 Jawaban:
Jawaban Terpilih
user[inti/parent] admin[cabang/child]
oneToMany[inverse] dibalik jadi manyToOne
nanti ada yg namanya *hasOne = ['one to one'] *hasMany = ['one to many'] *belongsTo/hasMany(inverse) = ['many to one'] *belongsToMany = ['many to many'] *hasManyThrough = ['many to Through'] example hasManyThrough:
Table Country [id] [name]
| V
Table User [id] [id_country] [name]
| V
Table Posts [id] [id_user] [name]
jadi many(banyak) nya turunan
itu penjelasan tentang relasinya..
0