Eloquent ORM 关联参数

Laravel ⋅ tytrock ⋅ at 2017-11-14 11:46:09 ⋅ 4705 Reads
$this->hasOne('App\Phone', 'foreign_key', 'local_key');
return $this->belongsTo('App\User', 'local_key', 'parent_key');
$this->hasMany('App\Comment', 'foreign_key', 'local_key');


Total Reply Count: 0
    No comments~~
    • publish_typography
    • publish_markdown
    • 支持表情,使用方法请见 Emoji 自动补全来咯,可用的 Emoji 请见 :metal: :point_right: Emoji 列表 :star: :sparkles:
    • publish_image
    • publish_draft
    Ctrl+Enter