Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update image.blade.php #5186

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

EGYWEB-Mohamed
Copy link
Contributor

Add default disk.

WHY

BEFORE - What was wrong? What was happening before this PR?

While uploading an image using image field it uploads to the default disk in my case is public but when using image columns it returns data value from DB with the asset function which is not correct because it's uploaded to storage path or to be more clear upload based on default disk path.

AFTER - What is happening after this PR?

Define default disk to image columns so it's not required me to write disk for each image column I have so it's use default one which is used in the field as well.

HOW

How did you achieve that, in technical terms?

by adding this row $column['disk'] = $column['disk'] ?? config('filesystems.default');
to check if this column has a different disk name to use or use the default one.

Is it a breaking change?

No, I don't think so.

How can we test the before & after?

upload an image using the image field then show it in a table using the image column without define disk.

If the PR has changed in multiple repos please provide the command to checkout all branches, eg.:

git checkout "dev-branch-name" &&
cd vendor/backpack/crud && git checkout crud-branch-name &&
cd ../pro && git checkout pro-branch-name &&
cd ../../..

Add default disk.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant