Coursecomp
  • Laravel
  • PHP
  • VSCode
  • WordPress
  • Databases
  • CSS
  • Misc

Home » Laravel » Page 10

How to update parent timestamp when a child is updated in Laravel

March 8, 2022

Laravel quick tip – you can update the parent model timestamp when a child has got updated. All you have to do is define a property called $touches, assuming you have a belongsTo or belongsToMany relationship.

Laravel iterate hasMany with count

March 7, 2022

Here’s how to loop through the collection with hasMany relationship

Posts navigation

Previous 1 … 9 10
© 2019-2023, CourseComp