ScotchDesign1's avatar

ScotchDesign1 wrote a reply+100 XP

1mo ago

By default, Laravel's HasTimestamps trait (vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasTimestamps.php) uses:

public function freshTimestamp()
{
    return Date::now()->startOfSecond();
}

You can override this to remove ->startOfSecond() by redefining the function in your App\Models\Model.php file:

use Illuminate\Support\Facades\Date;
public function freshTimestamp()
{
    return Date::now();
}