我正在使用Laravel 5.1。Laravel 5.1 - 雄辩的关系更新函数
我有表,user
表,users_detail
表oneToOne
关系。 我已经成功地将两个数据表显示为一种形式。
现在我想在我的控制器中运行update
函数。我已经知道如何在我的其他项目中运行update
函数单个表。你可以给我一个线索如何运行update
这个两个表在单个控制器?
我们是否需要使用此Laravel update()
函数?要不然?
我用这对我view
:
...
{!! Form::model($users, ['method' => 'PATCH', 'route' => 'dashboard.user.update', $users -> id]) !!}
<div class="form-group">
{!! Form::label('User ID', 'User ID:') !!}
{!! Form::text('id', $users->id, $attributes = array('id'=>'disabledInput', 'Disabled', 'class'=>'form-control', 'placeholder'=>'User ID')); !!}
</div>
...
<div class="form-group">
{!! Form::label('Place Of Birth', 'Place Of Birth:') !!}
{!! Form::text('placeOfBirth', $users->UsersDetail->placeOfBirth, $attributes = array('class'=>'form-control', 'placeholder'=>'Place Of Birth')); !!}
</div>
...
...
{!! Form::close() !!}
...