Skip to content

Unsync issue retrieving media immediately after toMediaCollection() in v9 #3480

@LufoX11

Description

@LufoX11

Hi. I'm not sure it's something it was alredy fixed in a later version but I'm facing this issue in v9 (I can't upgrade to v10 due to PHP < 8):

 98             $user->addMediaFromBase64(...)->usingName(...)->usingFileName(...)->toMediaCollection(...);
 99             $source = $user->getFirstMediaUrl(...);
100             dd($source); // ""

If I reload $user or add $user->load('media') after toMediaCollection() then it works as expected.

Am I doing something wrong?

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