Skip to content

fresh() not returning new instance #63

@helloiamlukas

Description

@helloiamlukas

Description

If you are editing an entry, save it and try to get a new instance with the fresh() method you will get the outdated entry back.

Example

$entry->set('title', 'New Title');
$entry->save();

dd(
    $entry->fresh()->title,
    \Statamic\Facades\Entry::query()->where('id', $entry->id)->first()->title,
);

This will output two different values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions