dragonlew9876 2015-12-01 19:17
浏览 73
已采纳

如何知道哪些字段已更新

I'm working in laravel 5, I have a module where the user can update the information of students, for that The user has a preloaded form with the current data and he can modify the fields that he wants.Then, in the controller I do:

$perfil->update(Input::all())

That works pretty good. So my question is: there's a way of get the name of the fields that have been updated?

  • 写回答

2条回答 默认 最新

  • dongxiaoguang9108 2015-12-01 19:59
    关注

    You want to use the dirty() method. this has been explained well here.

    Laravel Eloquent update just if changes have been made

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码