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
Package has feature to define fallback url or path which works great when getFirstMediaUrl or getFirstMediaPath return null.
However while using responsive images in blade.php we can't really use this feature. because getFirstMedia() still returns null. Maybe return new model instance with given fallback url/path? That would help getting rid of if/else in blade.php files
Example:
{{ $blog->getFirstMedia() }} // <-- returns null, nothing
{{ $blog->getFirstMedia()->img('', ['class' => 'post-img']) }} // <-- returns error, Call to a member function img() on null
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.
-
Package has feature to define fallback url or path which works great when
getFirstMediaUrl
orgetFirstMediaPath
return null.However while using responsive images in
blade.php
we can't really use this feature. becausegetFirstMedia()
still returns null. Maybe return new model instance with given fallback url/path? That would help getting rid of if/else in blade.php filesExample:
Beta Was this translation helpful? Give feedback.
All reactions