Answers for "How to know if eloquent update updates records in Laravel 6"

PHP
1

laravel model is dirty

if($product->isDirty()){
    // changes have been made
}
Posted by: Guest on December-28-2020
0

laravel update only changed fields

protected function performUpdate(Builder $query, array $options = [])
{
    $dirty = $this->getDirty();

    if (count($dirty) > 0)
    {
        // runs update query
    }

    return true;
}
Posted by: Guest on September-27-2020

Code answers related to "How to know if eloquent update updates records in Laravel 6"

Browse Popular Code Answers by Language