Decoding Laravel : Eloquent touch()

laravel eloquent touch

Today we are going to see about laravel eloquent touch method. Touch touch() is a method offered by eloquent that is used to update the updated_at field on the database table for the given model. For example, if you have a login system and you wanted to update the updated_at field whenever a user logs in (as last login), then you do this by $user->touch(). Laravel updates the updated_at field to current date and time.
Read more