You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a strange case where I add a file to Medialibrary and retrieve it via getFirstMedia right after and it returns null when executing for the first time. On the second run, everything is OK.
composer install
create DB, set the name in .env file
run php artisan migrate and visit the index page.
You'll see that it dumps the same model, but it returns null for the ->getFirstMedia call on the model.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have a strange case where I add a file to Medialibrary and retrieve it via
getFirstMedia
right after and it returnsnull
when executing for the first time. On the second run, everything is OK.To reproduce clone the repo:
https://github.com/4unkur/mergepdf
composer install
create DB, set the name in .env file
run
php artisan migrate
and visit the index page.You'll see that it dumps the same model, but it returns
null
for the ->getFirstMedia call on the model.Beta Was this translation helpful? Give feedback.
All reactions