Laravel 5 如何在laravel中更新表中的软删除值
因为我已经完成了这个链接中提到的步骤。。。 获取要编辑的数据时,请帮助尝试使用withTashed()Laravel 5 如何在laravel中更新表中的软删除值,laravel-5,soft-delete,Laravel 5,Soft Delete,因为我已经完成了这个链接中提到的步骤。。。 获取要编辑的数据时,请帮助尝试使用withTashed() // suppose user with id 2 is soft deleted. eg: User::find(2) // this will return null and you won't be able to update the user 要获取软删除的用户,应使用withTrashed() ref:只需将其设置为null我已经这样做了..但什么也没发生请检查并分享您的模型类非
// suppose user with id 2 is soft deleted.
eg: User::find(2) // this will return null and you won't be able to update the user
要获取软删除的用户,应使用withTrashed()
ref:只需将其设置为
null
我已经这样做了..但什么也没发生请检查并分享您的模型类非常感谢@phpdroid占用您的时间..我刚刚解决了问题..我更正了表名..问题已解决-:)
eg: User::withTrashed()->find(2)->update(['deleted_at' => null);
Or User::withTrashed()->find(2)->restore();