associate您可以在您的模型上使用belongsTo.
$contact= Contact::find(10);
$user->account()->associate($contact);
$user->save(); // You do need to update your user
Run Code Online (Sandbox Code Playgroud)
来源: http: //laravel.com/docs/eloquent
| 归档时间: |
|
| 查看次数: |
969 次 |
| 最近记录: |