0
我想实现更新配置文件的功能,这里是它保存数据 form图像文件没有移动到路径
形式,这里是它应该是保存图像的路径控制器controller
在用户类中的照片和用户中存在关系。
class User extends Authenticatable
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'firstName', 'lastName','userName' ,'email', 'password','photo_id',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
public function photo(){
return $this->belongsTo('App\Photo');
}
这里是请求文件。
public function rules()
{
return [
'firstName'=> 'required',
'lastName' => 'required',
'userName' => 'required',
'photo_id' => 'required',
'email' => 'required',
];
}
不知道我是怎么错过的:D 谢谢@Marnic Nabialek它工作:) –